為什么方法名字叫做run呢 改成fun就不調(diào)用了
package com.imooc.concurrent;
public class Actor extends Thread {
public void fun() {
System.out.println(getName() +"is an actor");
int count = 0;
System.out.println(getName() + "show begins"+(++count));
System.out.println(getName() +"show is over");
}
public static void main(String[] args) {
Thread actor = new Actor();
actor.setName("Mr.Thread");
actor.start();
}
}
2016-10-21
因為是繼承自Thread類,Thread類里面定義了run抽象類,父類定義的抽象類,非抽象類的字類必須實現(xiàn)父類定義的抽象方法。
2016-10-22
這是父類重寫的方法。