Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question on inner class

 
Dinesh Tahiliani
Ranch Hand
Posts: 486
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Inside an Inner Class, you cannot access the Enclosing Class's members by using 'this' keyword. The correct way is either use the member name plainly OR EnclosingClass.this.memberName


Can you explain me the meaning of this sentence please with help of example
 
Bhavik patel
Ranch Hand
Posts: 49
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Bhavik patel
Ranch Hand
Posts: 49
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry friend....I have removed example from this post. Please refer to next post.
[ June 24, 2008: Message edited by: Bhavik patel ]
 
Dinesh Tahiliani
Ranch Hand
Posts: 486
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks got it ..

Does similarly aplies of oter class methods also
Can inner access the outer class methods.

Please explain with example
 
Bhavik patel
Ranch Hand
Posts: 49
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes. It applies to all the non-static members of outer class.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic