How many lines does the following code output?
String[] days = new String[] { "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" }; for (int i = 0; i < days.size(); i++) System.out.println(days[i]);
C.
The code days.size()
would be correct if this was an ArrayList.
Since it is an array, days.length is the correct code.
Therefore, the code does not compile, and Option C is the answer.