Consider this Code
String variable = "";
variable = "3";
variable = "4";
Since string is immutable, there will be three objects created. But only the last object where the value is assigned to "4" is valid.
As per the definition, the objects used in the previous lines ( variable = "3" and variable ="") are still in the memory.
My question is , when an object is no longer in reference, can i still call it an Object or as a just un-usable memory location