This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Question about protected member 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 "Question about protected member" Watch "Question about protected member" New topic
Author

Question about protected member

Yin Stadfield
Ranch Hand

Joined: Oct 13, 2012
Posts: 43

Hi there folks,

So here is it:




How about if the subclass is within the same package as the superclass?



Thanks.
Praveen Kumar M K
Ranch Hand

Joined: Jul 03, 2011
Posts: 256
protected allows package-private access within a package.
Rakesh K. Cherukuri
Ranch Hand

Joined: Jun 01, 2010
Posts: 48

Yin Stadfield wrote:Hi there folks,
How about if the subclass is within the same package as the superclass?



To add to Praveen, that is allowed.


Warm Regards,
Rakesh
Yin Stadfield
Ranch Hand

Joined: Oct 13, 2012
Posts: 43

Cool. Thanks Praveen and Rakesh!
 
GeeCON Prague 2014
 
subject: Question about protected member