Originally posted by jone wiilum: yes output is 10 but how it come we have int i=20; in method
In the body of the method, a new variable "i" is declared. The new "i" is local to the method, and it's different than the static "i" that is declared in the class. When we say "this.i" we are getting the static "i" of this instance -- not the local "i".
[ August 24, 2007: Message edited by: marc weber ]
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer sscce.org
Who among you feels worthy enough to be my best friend? Test 1 is to read this tiny ad: