Home

Java Overloading Quiz 4

What is the output of the following code? (write "error" if the program does not compile or throws an exception)

 void method1(int a){
   System.out.println(1);
 }
 void method1(long a){
   System.out.println(2);
 }
 method1(111L);
Your answer: