If I update a method parameter to a new object will this be available for the entirety of the JVM life?
For example:
Class 1:
Pojo p = new Pojo("A");
class2.method2(p)
Class 2:
public void method2(Pojo p) {
p = new Pojo("B");
}
I know this is a bit of a silly example and the new object should be returned instead of updated like this but curious to know what the behavior will be in terms of scopes / garbage collection.