R
RHC
I have a question regarding garbage collection. Assume the following
public class Myclass
{
public Myclass()
{}
public int getTheNumberOne()
{ return 1;}
}
Now suppose in some other class, say a servlet or something I have the following..
int first = new Myclass().getTheNumberOne();
when / how is this new Object of type Myclass garbage collected???
TIA
RHC
public class Myclass
{
public Myclass()
{}
public int getTheNumberOne()
{ return 1;}
}
Now suppose in some other class, say a servlet or something I have the following..
int first = new Myclass().getTheNumberOne();
when / how is this new Object of type Myclass garbage collected???
TIA
RHC