Code Input file: int1to100.txt /* ReadWithResources.java David Klick 2018-01-08 CIS 260 This program uses Java's try-with resources to automatically take care of closing a file when done processing or if an error occurs. */ import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; import java.util.ArrayList; import java.util.List; public class ReadWithResources { public static void main(String[] args) { String filename = "int1to100.txt"; List contents = new ArrayList<>(); String lineIn; try (BufferedReader br = new BufferedReader(new FileReader(filename))) { while ((lineIn = br.readLine())!= null) contents.add(lineIn); } catch (IOException e) { System.err.printf("Error reading file %s%n", filename); System.exit(1); } for (String line : contents) System.out.println(line); } }