What is the result of the following?
1: List<Integer> list = Arrays.asList(10, 4, -1, 5); 2: Collections.sort(list); 3: Integer array[] = list.toArray(new Integer[4]); 4: System.out.println(array[0]);
A.
Line 1 creates a fixed size array of size 4.
Line 2 sorts it.
Line 3 converts it back to an array.
The brackets aren't in the traditional place, but they are still legal.
Line 4 prints the first element, which is now -1.