If I edit the data of an object in a function do I need to return the object back to update it in java.
Say I have something like this:
public void foo1() {
Foo foo = new Foo();
someFunction(foo);
// Is the state of foo changed here or not?
}
public void someFunction(Foo foo) {
foo.doSomething();
}
I know objects are passed by reference in java. Will this mean the object is updated/changed at the end of the foo1() function or not?