package edu.xcdq.Demo02;
/**
* @author yuhuicun
* @date 2021/5/19 8:41
*/
public class Demo02 implements Runnable {
@Override
public void run(){
System.out.println("新线程,实现接口的方法");
}
}
/*
1 实现接口
2 复写 run 方法
3 创建线程测试
*/
package edu.xcdq.Demo02;
/**
* @author yuhuicun
* @date 2021/5/19 8:45
*/
public class TestDemo02 {
public static void main(String[] args) {
Demo02 demo02 = new Demo02();
Thread thread = new Thread(demo02);
thread.start();
}
}