Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.*;
- import java.util.ArrayList;
- public class _02_AllCapitals {
- public static void main(String[] args) {
- try (
- BufferedReader reader = new BufferedReader(new FileReader(new File("resources/Problem1"))))
- {
- ArrayList<String> list = new ArrayList<String>();
- String line = reader.readLine();
- while (line != null) {
- list.add(line.toUpperCase());
- line = reader.readLine();
- }
- try ( PrintWriter writer = new PrintWriter(new FileWriter(new File("resources/Problem1"),false), false)){
- for (int i = 0; i < list.size(); i++) {
- writer.write(list.get(i));
- writer.println();
- }
- }
- }
- catch (FileNotFoundException fnf){
- }
- catch (IOException ioex){
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement