• Post Reply Bookmark Topic Watch Topic
  • New Topic

subclass inheritance  RSS feed

 
ben oliver
Ranch Hand
Posts: 375
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if class A extends B, and B extends C. So "C" is the grandparent class and "A" is the grandchild class. Will "A" be able to access every "protected" variable and method defined in class "C" ?
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 37507
552
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ben,
Yes. Everything you said is correct. Inheritance is transitive so all descendant classes can access the protected variables.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!