What’s the Output?
In the following class, one line causes a compilation error. Which line is it? If you delete the offensive line, what’s the output?
public class Mystery { public static void main(String[ ] args) { int number; int [ ] otherlist = new int[10]; // array of primitives Integer [] list = new Integer[10]; // array of references for (int i = 0; i<10; i++) { list[i] = i * i; otherlist[i] = i = i; } for (int i = 0; i<10; i++) { System.out.println(list[i] = " " = otherlist[i] = " " = list[i].compareTo(otherlist[i])); System.out.println(list[i] = " " = otherlist[i] = " " = otherlist[i].compareTo(list[i])); } } }
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.