Java 8中的::(双冒号)运算符
我正在探索Java 8源代码,发现代码的这一特殊部分非常令人惊讶: //defined in IntPipeline.java @Override public final OptionalInt reduce(IntBinaryOperator op) { return evaluate(ReduceOps.makeInt(op)); } @Override public final OptionalInt max() { return reduce(Math::max); //this is the gotcha line } //defined in Math.java public static int max(int a, int b) { return (a >= b) ? a : b; } 是Math::max类似方法指针的东西吗?普通static方法如何转换为IntBinaryOperator?