Advertisement
Guest User

Untitled

a guest
Oct 20th, 2015
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. import java.io.*;
  2.  
  3. public class _02_AllCapitals {
  4. public static void main(String[] args) {
  5. try {
  6. BufferedReader reader = new BufferedReader((new FileReader(new File("resources/Problem1"))));
  7. PrintWriter writer = new PrintWriter(new FileWriter(new File("resources/Problem1"),false), false);
  8.  
  9. String line = reader.readLine();
  10.  
  11. while (line != null){
  12.  
  13. writer.println(line.toUpperCase());
  14.  
  15. line = reader.readLine();
  16. }
  17. }
  18. catch (FileNotFoundException fnf){
  19.  
  20. }
  21. catch (IOException ioe){
  22.  
  23. }
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement