public static void main(String[] args) {
useFunction("100",s -> Integer.parseInt(s),s -> String.valueOf(s+566));
}
public static void useFunction( String s,Function<String,Integer> f,Function<Integer,String> f1){
String ss = f.andThen(f1).apply(s);
System.out.println(ss);
} |
|