jdk8新特性

https://www.cnblogs.com/justcooooode/p/7701260.html#_label0

package com;
import java.util.Comparator;
import javax.swing.JButton;

public class Test2 {
public static void main(String[] args) {
new Thread(() -> {
for (int i = 0; i < 100; i++)
System.out.println("Lambda Expression");
}).start();
}
public static void test() {
Comparator<String> c = (s1, s2) -> Integer.compare(s1.length(), s2.length());
JButton button = new JButton("click");
button.addActionListener(e -> System.out.println("Lambda Expression"));
}
}

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章