Aniket S. Kulkarni wrote:Mohamed Sanaulla,
If your instance variable & method's variable(i.e.local to method) are same then this is used to avoid ambiguity.
Its something called as Shadowing variables. Atleast thats what
SCJP Guide uses in their explanation.
Aniket S. Kulkarni wrote: Using 'this' we can implement "Instance Variable Hiding"
"Instance Variable Hiding" - These words (in the above quote context) mean that instance variable is being hidden.
But what you have stated above is that "this" is used to resolve the ambiguity in referring to the variables with same name for local as well as the instance level- which is correct. And its not same as "Instance variable hiding".
The term being used is conveying a different meaning as the context in which you are using the term is different from that used in the article you linked in previous post. So I was trying to clarify this so that it doesn't confuse other readers who might be new to the keywords and terminology.