}
}
A. The program runs and prints 2 followed by “max(double, int)” is invoked.
B. The program cannot compile because the compiler cannot determine which max
method should be invoked.
C. The program runs and prints “max(int, double) is invoked” followed by 2.
D. The program runs and prints 2 followed by “max(int, double)” is invoked.
E. The program cannot compile because you cannot have the print statement in a non-
void method.
#
15. Analyze the following code:
public class Test {
public static long xMethod(long n, long l) {
System.out.println(“long, long”);
return n;
}
}
A. The program does not compile because the compiler cannot distinguish which
xmethod to invoke.
B. The program runs fine but displays things other than 5.
C. The program displays long, long followed by 5.
D. The program displays int, long followed by 5.
#
16. What is Math.floor(3.6)?
A. 5.0
B. 3
C. 3.0
D. 4
#
17. How many elements are in array double[] list = new double[5]?