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.
this.i refers to instance variable. Instance variable i is overridden in wine method to 10, hence 10 is the output. Incase if you print(i), 20 will be the output. since i represents local variable declared in wine method and has the value of 20. Hope it helps.
Joined: Feb 26, 2002
thanks i got it
Joined: Feb 07, 2005
I wanted to clarify my last remark.
When a static member of a class is referred to using a qualified instance, then it is irrelevant which instance refers to the static member.
The type of the class is what matters.
You create a local variable named i after you modify the static member i.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com