67,512
社区成员
发帖
与我相关
我的任务
分享
Function<String, String> f1 = String::toUpperCase;
System.out.println(f1.apply("ab"));
实际等价于
System.out.println("ab".toLowerCase());
但是第二个function
Function<String, Boolean> f0 = String::matches;
System.out.println(f0.apply("aa"));
你能等价于什么呢,参数都对应不上
System.out.println("aa".matches(????));
很明显这个方法你不能用::来写