• Post Reply Bookmark Topic Watch Topic
  • New Topic

method overriding and visibility promotion.  RSS feed

 
Rashid Mian
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Anton Uwe
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, for the compiler, "superClass" has no method "smile(..)" because "smile(..)" in SuperClass was defined to be protected and we are in a different package than SuperClass is in, and we are not in a class inheriting from SuperClass. So, the compiler doesn't "see" "smile(..)".
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!