aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Class Method - Hiding (or Revealing?) 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 "Class Method - Hiding (or Revealing?)" Watch "Class Method - Hiding (or Revealing?)" New topic
Author

Class Method - Hiding (or Revealing?)

Shanel Jacob
Ranch Hand

Joined: Jun 18, 2006
Posts: 112
Hi all, Was looking at:

http://java.sun.com/docs/books/tutorial/java/javaOO/override.html

The example at the end shows subclass static method "hides" the superclass static method - It was the method in the superclass that gets called.

Am a little confused with the term "hide". My current interpretation seems that it is more like "revealing". As in, its the method in the superclass that is being used (revealed).
Aum Tao
Ranch Hand

Joined: Feb 14, 2006
Posts: 210
Here, static method in the superclass is hidden from the subclass, rather than the user/programmer. Static methods are also final by default. Hence, they cannot be overridden.


SCJP 1.4 85%
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
Consider the following similar but simpler code:


The term "hiding" is meant to be taken from the subclass AS1 point of view. Method AS1.m() in the subclass hides method AS.m() in the superclass.


Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
 
 
subject: Class Method - Hiding (or Revealing?)