class Animal{
public static void m1(){
System.out.println("Animal m1()");
}
}
class Bird extends Animal{
public static void m1(){
System.out.println("Bird m1()");
}
}
public class Test{
public static void main(String[] args){
Animal a=new Brid();
a.m1();
}
}
打印结果是Animal m1()
如果不是静态方法则打印结果是Brid m1()