实例方法引用语法如:str::endswith
例如:
public class ParseIntTest {
public static void main(String[] args) {
String str = "itsource_hello";
Function<String, Boolean> fun1 = str::endsWith;
Boolean b = fun1.apply("hello");
System.out.println(b);
}
}
|
蔡香满屋
站在牛顿头上吃苹果 |