thread 中super关键字

public class Mother extends Thread{
String name;
public Mother(String name) {
this.name = name;
}
@Override
public void run() {
System.out.println("mother");
}
}
public class Son extends Mother{
String name;
public Son(String name) {super(name);this.name = name;}
@Override
public void run() {System.out.println(name);}
public void startup(){super.start();}}
public class Launch {
public static void main(String[] args) {
Mother mother = new Mother("mother");
Son son = new Son("son");
son.startup();
}
}
为什么打出了son???
我的startup()方法里调的是super.startup()啊

繁星点点滴滴
浏览 414回答 1
1回答
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Java