sorry if this is a dumb question. I'm newbie to Java ( coming from a PHP background ). So here is what I have.
String variable = new String("whatever");
//instanceof String == true here
variable = null;
//whereas here instanceof String == false
variable = new Integer(3);// error
Doesn't setting the variable to null remove it's refference, since I instantiated it with an object type? Is there a way I can keep the variable name but change it's data type? Thank you