Given a sample code:
1 public class Test2 {
2 public static void main(String[] args) {
3 int i = 1;
4 Integer I = new Integer(i);
5 method(i);
6 method(I);
7 }
8 static void method(Integer I) {
9 System.out.print(" Wrapper");
10 }
11 static void method(int i) {
12 System.out.print(" Primitive");
}}
What will be the result of above code ?
(1) Primitive Wrapper
(2) Wrapper
(3) Primitive
(4) Wrapper Primitive
(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.