1 public class Static { 2 3 public static void main(String[] args) { 4 A a = new A(); 5 a.a();// a 6 7 A a1 = new B(); 8 a1.a();// a 9 B a2 = new B();10 a2.a();// b11 }12 13 }14 15 class A {16 17 public static void a() {18 System.out.println("a");19 20 }21 }22 23 class B extends A {24 // 不能@Override,编译器会报错25 public static void a() {26 System.out.println("b");27 }28 29 } annotation:类的加载情况以后会写到