- False. The length of an array is always the value that it is initialized as, in this case 10. - True. Just like a variable of type A can hold a B object, an ArrayList of type A can hold B objects. - 1) It communicates to anyone looking at the code that this is a variable that will not change. 2) Java will enforce that and won't allow you to change it, avoiding accidentally changing it. - Returns the String that occurs most frequently in the ArrayList. O(n^2). - The mystery number is: 0 true -- The mystery number is: 10 false -- The mystery number is: 0 true -- - public void reverseFile(String infile, String outfile) { try { ArrayList lines = new ArrayList(); BufferedReader in = new BufferedReader(new FileReader(new File(infile))); PrintWriter out = new PrintWriter(new FileOutputStream(outfile)); String line = in.readLine(); // add all the lines in the file to an arraylist while( line != null ) { lines.add(line); line = in.readLine(); } // write them to the output file starting from the end for( int i = lines.size()-1; i >= 0; i-- ) { out.println(lines.get(i); } out.close(); in.close(); } catch (IOException e) { System.out.println("Something bad happened :("); } }