Let's say I have something like:
I believe that when I pass the object to the function makeNull it passes a clone, and not the reference?
Still I need this functionality in a project of mine. I should be able to make an object null in a method, so that in the other parts of the program it's null too...
any ideas?
Code:
Object o;
main{
o = new Object();
makeNull(o);
system.out.println (o == null) // should be true
}
public void makeNull(Object o){
o = null
}
Still I need this functionality in a project of mine. I should be able to make an object null in a method, so that in the other parts of the program it's null too...
any ideas?
Comment