The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Doubt in john meyers' question... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Doubt in john meyers Watch "Doubt in john meyers New topic

Doubt in john meyers' question...

Gabriel Ozeas
Ranch Hand

Joined: Jul 04, 2008
Posts: 30

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

Joined: Oct 09, 2007
Posts: 206

private members of a class can be accessed by the methods of the same class

Enjoy, Chander
SCJP 5, Oracle Certified PL/SQL Developer
I agree. Here's the link:
subject: Doubt in john meyers' question...
It's not a secret anymore!