This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes method overriding and visibility promotion. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "method overriding and visibility promotion." Watch "method overriding and visibility promotion." New topic

method overriding and visibility promotion.

Rashid Mian
Ranch Hand

Joined: Feb 14, 2007
Posts: 31
Anton Uwe
Ranch Hand

Joined: Jan 10, 2007
Posts: 122
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(..)".
I agree. Here's the link:
subject: method overriding and visibility promotion.
It's not a secret anymore!