GeeCON Prague 2014*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Regarding determining access to class members 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 "Regarding determining access to class members" Watch "Regarding determining access to class members" New topic
Author

Regarding determining access to class members

Pranali Brahmankar
Greenhorn

Joined: Jan 17, 2010
Posts: 3
Hello,
I just started preparing for SCJP. I'm reading the book - SCJP study guide by Kathy Sierra and Bert Bates.
The table 1.2 named - Determining Access to Class Members, isn't it incomplete? I think there must be 2 more columns to it as given in the chart as follows-
http://1.bp.blogspot.com/_KLB31OYxZAs/S1NOUNPryVI/AAAAAAAABCg/agimwFpcULM/s1600-h/table.JPG

http://techie-butterfly.blogspot.com/2010/01/behavior-of-inherited-protected.html
will explain why i prepared that chart so.

Please correct me if I'm wrong.
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9303
    
  17

Hi Pranali, welcome to javaranch.

I think the two columns that you added are redundant. The 3rd and 4th rows say "From a subclass in the same package" and "From a subclass outside the package". So if you match those two rows with the protected column, you'll yes in both cases. This is what your extra two columns also signify. And those two columns don't make much sense in case of rows 1,2 and 5 as the columns mention subclass in same and different package but the rows are talking about non-subclasses...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
rushikesh sawant
Ranch Hand

Joined: Dec 22, 2009
Posts: 65
hi pranali, that table is complete one. Those two additional columns can be derived from this table.


SCJP 5.0 100%
Pranali Brahmankar
Greenhorn

Joined: Jan 17, 2010
Posts: 3
OK. I agree that these 2 columns are derived from the basic chart. But i think even they are necessary and are not redundant if we don't think only of sub-classing.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Regarding determining access to class members