I have a feeling this question will be obvious, but I think the questions should still be asked just to be safe.
If I have a class that accepts parameters, and I continuously call the same class with the same reference name, but different parameters, do I have to null out the previous class instance to prevent ram from getting eaten up with every new instance? for example
RandomClass className = new RandomClass(argument1);
while(className.classMethod() != null){
className = new RandomClass(argument i)
i++;
}
I'm assuming The className
with argument one would be destroyed when className
with argument2 is called? or would I have to
RandomClass className = new RandomClass(argument1);
while(className.classMethod() != null){
className = new RandomClass(argument i);
className = null;
i++;
}
just to be safe?