This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Doubt in john meyers' question...

 
Gabriel Ozeas
Ranch Hand
Posts: 30
Google App Engine Hibernate jQuery
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi folks, i have a doubt about modifiers in this question from john meyers



why the compare method can access t1.x and t2.x if they are private? i compile and run this code but no compiler or runtime error appeared...

thxz everyone!
 
chander shivdasani
Ranch Hand
Posts: 206
Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
private members of a class can be accessed by the methods of the same class
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic