继承Thread类
1、子类继承Thread类具备多线程能力
2、启动线程:子类对象.start()
3、不建议使用:避免oop单一继承局限性
public class TestThread1 extends Thread {
@Override
public void run() {
for (int i = 0; i < 200; i++) {
System.out.println("我在写代码~~~"+i);
}
}
public static void main(String[] args) {
TestThread1 testThread1 = new TestThread1();
testThread1.start();
for (int i = 0; i < 1000; i++) {
System.out.