Suppose you have two methods in a class.
public void test(Integer iObject) { System.out.println("Integer=" + iObject); } public void test(int iValue) { System.out.println("int=" + iValue); }
Suppose you make two calls to the test() method.
test(101);
test(new Integer(101));
int=101 Integer=101
For primitive parameter value, for example, test(10);
For reference parameter value, test(new Integer(101));
public class Main { public static void main(String[] args) { test(101);/* w w w .j a va 2 s . com*/ test(new Integer(101)); } public static void test(Integer iObject) { System.out.println("Integer=" + iObject); } public static void test(int iValue) { System.out.println("int=" + iValue); } }