package com.freeflying.thread.base;
/**
* @ClassName: ImplementsRunable
* @Description:realize thread by implements runable interface
* @author freeflying
* @date 2018年6月21日
*/
public class ImplementsRunable{
public static void main(String[] args) {
MyRunable1 myRunable1=new MyRunable1();
Thread thread = new Thread(myRunable1);
thread.start();
System.out.println("run end!!!");
}
}
class MyRunable1 implements Runnable{
@Override
public void run() {
System.out.println("current thread is running!");
}
}
实现runable来实现多线程
最新推荐文章于 2021-03-05 12:50:16 发布