Just wondering if that when you set
obj1 = null;
[obj1, obj2, null, obj3, null, obj 4, obj5]
There is no "null object", and null is the closest thing that exists to an empty reference. The key definitions are in the Java Language Specification, 4.3.1. Objects:
An object is a class instance or an array.
The reference values (often just references) are pointers to these objects, and a special null reference, which refers to no object.
obj1 = null; changes the reference variable
obj1 to be null. If it previously referred to an object it no longer does so.
There may be other references that refer to that object, so that the object remains reachable, and the garbage collector will leave it alone. If
obj1 was the last reference to the object, it is no longer reachable, and is eligible for finalization.