hi,
Static methods can't be overridden but they can be redefined (from K&B)
class Animal {
static void doStuff() {
System.out.print("a ");
}
}
class Dog extends Animal {
static void dostuff() { // it's a redefinition, not an override
System.out.print("d ");
}
public static void main(
String [] args) {
Animal [] a = {new Animal(), new Dog(), new Animal()};
for(int x = 0; x < a.length; x++)
a[x].doStuff(); // invoke the static method
}
}
in this how to recognise tht dostuff() is redefined??