In Java, we can use the wrapper classes for declaring a variables. For example
Integer x=5;
This means that there is a reference 'x' that points to a value of 5.
Then I declared another reference called y that points to the same value
Integer y=x; //now y should point to the number "5"
then I changed the value which y points to
y=20;
Doesn't this make both x and y point to 20 ? because when I print x , I still get 5
y=20is the same asy = Integer.valueOf(20), soyreferences a different object afterwards.