class A { int age; } class B extends A { String name; } class C extends B { age = 3; name = 小明; public void speak(){ System.out.println(name+"今年的岁数为:"+age); } } class Demo { public static void main(String[] args){ C c = new C(); c.speak(); } } 为什么会显示需要标识符?
lvanli
tanhouyusheng
yanrun
相关分类