public class Exa {
public static void main(String[] args) {
Integer b = new Integer(10);
add(b);
System.out.println(b.intValue());
}
public static void add(Integer b){
int i = b.intValue();
i += 3;
b = new Integer(i);
System.out.println("b="+b+",i="+i);
}
}
I wrote the above code, and run output 10. Why did it not change?
Why output 10, please give detailed instructions,thanks!