What is the life of a Java Object that is passed a method argument?
For example I have an object Test
class Test{
public string testType(){
.....
}
}
and I have two classes A and B
class classA{
classB b = new classB();
void nextQuestion{
b.start(new Test());
}
}
class classB{
void start(Test test){
doSomething(test.testType());
}
}
so now what is the life of the Test object? Is it only till the end of the start method or will it be alive till the end of classB or while it alive till the end of classA or is something else.