Advertisement
baxlash

AllCapitals.java

Mar 24th, 2016
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.81 KB | None | 0 0
  1. import java.io.*;
  2.  
  3. /**
  4.  * Created by Baxlash on 22.3.2016 г..
  5.  */
  6. public class AllCapitals {
  7.     private static final String FILE_PATH = "resources/input.txt";
  8.     private static final String SAVE_FILE = "resources/output.txt";
  9.     public static void main(String[] args) {
  10.         File input = new File(FILE_PATH);
  11.         File output = new File(SAVE_FILE);
  12.         try (BufferedReader bfr = new BufferedReader(new FileReader(input)); PrintWriter pw = new PrintWriter(new FileWriter(output));){
  13.             String line = bfr.readLine();
  14.             while (line!=null){
  15.                 line = line.toUpperCase();
  16.                 pw.println(line);
  17.                 line = bfr.readLine();
  18.             }
  19.         } catch (IOException ioex) {
  20.             System.out.println("GOTCHA!");
  21.         }
  22.     }
  23.  
  24.  
  25.  
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement