What is the result?

Given:
1. public class A {
2. public String doit(int x, int y){
3. return "a";
4. }
5.
6. public String doit(int… vals){
7. return "b";
8. }
9. }
and:
25. A a = new A();
26. System.out.println(a.doit(4, 5));
What is the result?
A. Line 26 prints "a" to System.out.
B. Line 26 prints "b" 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.

Download Printable PDF. VALID exam to help you PASS.

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.