About Question enthuware.ocpjp.v8.2.1866 :
Posted: Sun Jun 19, 2016 9:08 am
If your only goal is to make the code compile you can do either one:
- Remove code at //2
or
- Change //3 to: Function<Integer, Integer> f = x->x+(int)(x*rate);
No need to do both.
When you do both you're changing the logic. If rate equals 0, for instance, you'd be multiplying payment by 0 and not by 0.1 like before.
- Remove code at //2
or
- Change //3 to: Function<Integer, Integer> f = x->x+(int)(x*rate);
No need to do both.
When you do both you're changing the logic. If rate equals 0, for instance, you'd be multiplying payment by 0 and not by 0.1 like before.