• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

Regarding determining access to class members

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 9697
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
I wish to win the lottery. I wish for a lovely piece of pie. And I wish for a tiny ad:
Garden Master Course kickstarter
https://coderanch.com/t/754577/Garden-Master-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic