which basically means that "asd" is stored somewhere in your memory.
if you then perform:
str = "new asd";
this doesn't mean that the object "asd" doesn't exist anymore, but you don't have a reference to it anymore. now str will be a reference to "new asd" while "asd" remains on the same position in your memory, ready to either be referenced to again, or to be cleaned up.
When your object has no remaining references it can be garbage collected. Because you have no remaining references there is no way ever to get it again (excluding very technical/obscure stuff with garbage collection internals).
As Norm says Strings are highly optimised in Java, so depending on how "asd" is created Java may keep that string in memory and re-use that memory later if you create another "asd" object - but this is strictly an internal optimisation and has no effect on how your program runs, other than maybe to make it faster.
I am working creating a fully encapsulated, homogeneous singly linked data structure. The Listing class and SinglyLinkedList class that are part of the whole application compile fine, but the problem ...