静态方法的引用
package net.wanho.test; import java.util.function.Function; public class TestAbs { public static void main(String[] args) { //静态方法的引用 Function<Double, Double> function = Math::abs; double b = (double) function.apply(-2.0); System.out.println(b); } }
绝对值