通过Lambda表达式实现多线程

 1 package testBlog;
 2 //通过Lambda表达式实现多线程
 3 public class Test {
 4     public static void main(String[] args) {
 5         String name = "线程的对象:";
 6         new Thread(() -> {//重点在于:() ->
 7             for (int x = 0; x < 20; x++) {
 8                 System.out.println(name + x);
 9             }
10         }).start();
11         ;
12         ;// 这里为什么多个分号都不报错???
13 
14     }
15 }
原文地址:https://www.cnblogs.com/ssC2H4/p/8186365.html