Hi
* static methods are not overriden
* static methods are hided
instead of putting my own code, i leave it to sun & hope u'll get it!
----------------fromSun---------------------------------------
A hidden class (static) method can be invoked by using a reference whose type is the class that actually contains the declaration of
the method. In this respect, hiding of static methods is different from overriding of instance methods. The example:
class Super {
static
String greeting() { return "Goodnight"; }
String name() { return "Richard"; }
}
class Sub extends Super {
static String greeting() { return "Hello"; }
String name() { return "Dick"; }
}
class
Test {
public static void main(String[] args) {
Super s = new Sub();
System.out.println(s.greeting() + ", " + s.name());
}
}
produces the output:
Goodnight, Dick
because the invocation of greeting uses the type of s, namely Super, to figure out, at compile time, which class method to invoke,
whereas the invocation of name uses the class of s, namely Sub, to figure out, at run time, which instance method to invoke.
--------------------------------------------------------------
Rgds,
ANaveenS