Multiple Choices
(Choose 1 answer)
1. public class Test {
2. public String foo(int x, int y) {
3.return "AA";
4. }
5.
6. public String foo(String[] arr) {
7.return "BB";
8. }
9.}
Given:
25. Test a=new Test();
26. System.out.println(a.foo(4, 5));
What is the result?
A. Line 26 prints "AA" to System.out.
B. Line 26 prints "BB" to System.out.
C. An exception is thrown at line 26 at runtime.
D. Compilation of class A will fail due to an error in line 6.