一、创建线程的三种方式

第一种

public class App {

  public static void main(String[] args) {

    Thread thread = new Thread(() -> {
      while (true) {
        System.out.println("testThread");
      }
    });

    thread.start();
  }
}
new Thread 创建线程

相关文章: