I have this code
clase MiObjeto = new clase("Nombre1");
MiObjeto = null;
Did I free space in Name1 memory by assigning it the null value?
I have this code
clase MiObjeto = new clase("Nombre1");
MiObjeto = null;
Did I free space in Name1 memory by assigning it the null value?
Technically if you would be releasing it. When you assign null to a variable, you are leaving it inaccessible. Then in java there is a process in the virtual machine called garbage collector that runs every so often and frees the memory of inaccessible objects.
Instantly not. What you have done is remove the reference that existed to the newly created object. The memory will be released when the GC is executed, detect that the object has no references and delete it.
No, you just changed the memory reference (you stopped using it), the Java Garbage Collector takes care of deleting the memory locations that are no longer being used.
In conclusion:
A little more about the Garbage Collector