Imagine your have two baskets where you put your cloths in. If you put the first basket into the second basket and put cloths in it, in which basket are the cloths ? If put the first basket in the second basket again (although it was already in there) and add some more cloths, in which basket are the cloths ?
What I'm trying to say (in a very confusing way
), is that e2 is always e1. The Echo() instance represented by "Echo e2 = new Echo();" will be discarded as soon as e2 = e1. Only e1 is alive. Everything happens in e1. e2 is e1. So e2.count = e2.count + 1; is actually e1.count = e1.count + 1;. System.out.println(e2.count); is actually System.out.println(e1.count);...