The value in the array is just a reference. It's just like doing this:
Obj a = new Obj("a");
Obj t0 = a;
a = new Obj("b");
At the end, the t0
variable has the value it was given on line 2 - that is, a reference to the first Obj
that's created on line 1. Changing the value of the a
variable doesn't change the value of t0.
Once you understand the above, just think of an array as a collection of variables, e.g.
Obj[] t = new Obj[10];
is roughly like declaring:
Obj t0, t1, t2, t3, t4, t5, t6, t7, t8, t9;
(There are plenty of differences, but in the context of this question they're similar.)