亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

代碼
提交代碼
import java.util.Comparator; public class MethodReferencesDemo2 { public static void main(String[] args) { // 使用 Lambda 表達式 Comparator<Integer> comparator1 = (t1, t2) -> Integer.compare(t1, t2); System.out.println(comparator1.compare(11, 12)); // 使用方法引用,類 :: 靜態方法( compare() 為靜態方法) Comparator<Integer> comparator2 = Integer::compare; System.out.println(comparator2.compare(12, 11)); } }
運行結果