Given a sample code:
1 public class Test {
2 public static void main(String[] args) {
3 int i = 1;
4 method(i);
5 }
6 static void method(int i){
7 System.out.println("Primitive");
8 }
9 static void method(Integer i){
10 System.out.println("Wrapper");
}}
What will be the result of above code ?
(1) Primitive
(2) Wrapper
(3) Compile time error at line no 6.
(4) Compile time error at line no 9.
(1)
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.