This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
hi Claire well, in test class we don't have another int i and String s defined right? so, we have ONLY ONE copy of variable i and variable s hence super.i = this.i for test object and super.s = this.s as well. do u see what i mean? super.i and this.i is just different mehtods of referring to same variable here (same for super.s and this.s).. try , System.out.println(super.s == this.s ); in compare() method, it will return u "true" meaning both the String referrences are same... regards maulin
Joined: Aug 30, 2002
I see what you mean, I forgot that I created 2 objects in the main method, thanks a lot.