public class Autoboxing {
public static void main(String[] args) {
int x=10;
Integer oldValue=x;
change(oldValue);
System.out.println("value:"+oldValue);
}
static void change(Integer value){
value=100;
}
}
Hi, I am trying to autobox a int value into Integer type. Then pass the Integer object to a method to change the number . But the number doesnt change. it still prints out 10? Could some one spot my error. Thanks in advance.