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

代碼
提交代碼
import java.util.Comparator; import java.util.function.Function; public class MethodReferencesDemo3 { public static void main(String[] args) { // 使用 Lambda 表達式 Function<Double, Long> function1 = d -> Math.round(d); Long apply1 = function1.apply(1.0); System.out.println(apply1); // 使用方法引用,類 :: 靜態方法( round() 為靜態方法) Function<Double, Long> function2 = Math::round; Long apply2 = function2.apply(2.0); System.out.println(apply2); } }
運行結果