Sorry for the potentially dumb question. I'm pretty new to java and I'm trying to understand objects. Have a look at this code:
public class Test {
public static void main(String[] args) {
Name name = new Name("john");;
System.out.println(Name.returnName());
name = new Name("jane");
System.out.print(Name.returnName());
}
}
Thís prints john and jane. Does that mean that when the code executes name = new Name("jane");
it deletes the previous object where the name is "john"? Thanks in advance.