private static void calcola(int i , function<integer , integer>fn){ int r = 0 ; for (int j = i ; j>0 ; j--) r = fn.apply(r); System.out.println(r); } calcola (9 , (p) -> { return p + 1;});
private static void calcola(int i , function<integer , integer>fn){
int r = 0 ;
for (int j = i ; j>0 ; j--) r = fn.apply(r);
System.out.println(r);
}
calcola (9 , (p) -> {
return p + 1;});