Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question about protected member

 
Yin Stadfield
Ranch Hand
Posts: 58
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 256
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
protected allows package-private access within a package.
 
Rakesh K. Cherukuri
Ranch Hand
Posts: 48
Eclipse IDE Fedora Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Yin Stadfield
Ranch Hand
Posts: 58
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Cool. Thanks Praveen and Rakesh!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic