class Zi extends Fu{
//void show2(){
// System.out.println("zi show");
//}
void show(){
System.out.println("zi show");
}
void speak2(){
System.out.println("java");
}
}
class Extends Demo3{
....main(..){
Zi z = new Zi();
(1) /*****可以调用子类或者父类的方法********
z.show1();
z.show2();
***************/
(2) z.show(); //子父类同名,会调用子类的show
z.speak();
}
}
例子二:
class Tel{
void show(){
System.out.println("number");
}
}