13
}
}
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.
#
15. Analyze the following code:
public class Test {
public static void main(String[] args) {
System.out.println(xMethod(5, 500L));
}
public static int xMethod(int n, long l) {
System.out.println(“int, long”);
return n;
}
public static long xMethod(long n, long l) {
System.out.println(“long, long”);
return n;
}
}
#
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]?