• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Regarding determining access to class members

 
Pranali Brahmankar
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9521
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
rushikesh sawant
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi pranali, that table is complete one. Those two additional columns can be derived from this table.
 
Pranali Brahmankar
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic