这里最后一句super:: concatString我不太懂

二,对象::实例方法
我们可以把一个实例的非静态方法作为Lambda体,比如这样:

@FunctionalInterface
public interface ImTheOne {
String handleString(String a, String b);
}
class OneClass {
public String concatString(String a, String b) {
return a + b;
}
}

public class Test {
public static void main(String[] args) {
OneClass oneClass = new OneClass();
ImTheOne theOne = oneClass::concatString;
String result = theOne.handleString("abc", "def");
System.out.println(result);

    //相当于以下效果
    OneClass oneClass2 = new OneClass();
    ImTheOne theOne2 = (a, b) -> oneClass2.concatString(a, b);
    String result2 = theOne2.handleString("123", "456");
    System.out.println(result2);

}

}
这段代码中,先定义了OneClass的一个对象,然后把对象的concatString()方法作为Lambda体。

注意:

1,这种模式下, concatString()方法不能标记为静态方法,否则编译会报错。

2,这里的对象可以是父对象,比如可以使用:

super:: concatString
这种形式(如果有父类有这个方法的话)。

super 父类
意思就是可以直接用有继承关系的函数