I am passing integer object reference
public class Test1 {
public static void main(String args[]){
Integer x = new Integer(56);
Integer y = new Integer(34);
Test1 test = new Test1();
test.change(x,y);
System.out.println("Values inside main() after calling change method");
System.out.println("x :"+ x +"; y :"+y);
}
public void change(Integer x1, Integer y1){
x1 = 45;
y1 = 1000;
System.out.println("Values After Modification inside change method");
System.out.println("x1 :"+ x1 +"; y1 :"+y1);
}
}
but there is no change in value of x and y ?? Please help...Thank you in advance. Here is the output.
Values After Modification inside change method
x1 :45; y1 :1000
Values inside main() after calling change method
x :56; y :34