K
K
kronus9152014-06-04 20:22:43
Java
kronus915, 2014-06-04 20:22:43

Object value reset (java)?

I have a method, I add an object to it through the argument, in the method I change this object in every possible way, and when the method exits, the values ​​\u200b\u200bare not saved ... in one book I saw something about this, but I don’t remember which book , but in Google it was not possible to score a normal question ...
in general, how to save changes to an object after exiting a method?
language-java

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
Maxim Moseychuk, 2014-06-05
​​@kronus915

Maybe you have a bug in your code? That sheet that you posted in the comments is impossible to read. The simplest example works.

D
Dm13y, 2014-06-04
@Dm13y

give an example code, then it will be possible to say something

I
IceJOKER, 2014-06-04
@IceJOKER

pass the value by reference (i.e. use the Integer, String or other wrapper) or make the variable global

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question