hi all
here is my code.
class Super
public void m1(){
System.out.println("super m1");
}
public static void m2(){
System.out.println("super static m2");
}
}
public class Child {
public void m1(){
System.out.println("child m1");
}
public static void m2(){
System.out.println("child static m2");
}
public static void main(
String arg[]){
Child t = new Child();
System.out.println((Super)t.m1()); // 1
System.out.println((Super)t.m2()); // 1
}
}
and the output is :
child m1
super static m2
why ?
anybody can explain overriding of static method.