class Test2_Extends {
public static void main(String[] args) {
Son s = new Son();
s.print();
s.method();
}
}
class Father {
//String name;
public void print() {
System.out.println("Fu print");
}
public void method() {
System.out.println("fu.Method");
}
}
class Son extends Father {
public void method() {
super.print();
super.method();
System.out.println("Zi Method");
}
}
|
|