在下面的示例案例中,使用函数样式时我有什么优势?>
我有下面的方法
public static String someMethod(String source) {
//some operation
return source;
}
我将上面的方法更改为下面的样式。
public static Function<String,String> process = source -> {
//some operation
return source;
}
我对以上更改(包括运行时的性能)有什么好处?
我在下面的示例案例中使用函数样式时有什么优势,我有下面的方法public static String someMethod(String source){//一些操作返回源; } I ...
使用Function
不能使您的代码正常工作。