引用符
// ::
通过对象名引用成员方法
// 对象名::成员方法
// 示例
s -> sample::sampleMethod(s);
sample::sampleMethod;
通过类名引用静态方法
// 类名::静态方法
s -> Math.sqrt(s);
Math::sqrt;
通过this/super引用成员方法
// this::成员方法
// super::成员方法
// this
() -> this.thisMethod();
this::thisMethod;
// super
() -> new Father().fatherMethod();
super::fatherMethod;
通过类名引用构造器
// 类名::new
// 数组::new
// 类构造器
() -> new Sample();
Sample::new;
// 数组
String[] strings = method(int length, length -> new String[length]);
String[] strings = method(int length, String[]::new);