I create an Integer variable in one class and pass it to another class. How can I change the value of this variable in another class without changing the link?
For example, if the passed reference is Integer z , and I change it: for example, Integer z = 5; . It turns out that this is a new reference for z ; nothing has changed for the old variable.