public class Mother extends Thread{String name;public Mother(String name) {this.name = name;}@Overridepublic void run() {System.out.println("mother");}}public class Son extends Mother{String name;public Son(String name) {super(name);this.name = name;}@Overridepublic 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()方法里調(diào)的是super.startup()啊
thread 中super關(guān)鍵字
繁星點(diǎn)點(diǎn)滴滴
2019-03-21 18:19:03