Hello, Question for Option 1:
public static double compute(double base, Function<Integer, Integer > func){
return func.apply((int)base); }
What is the data type returned? Isn't it a double as per method name? Thanks.
About Question enthuware.ocpjp.v11.2.3075 :
Moderator: admin
-
- Posts: 22
- Joined: Thu Dec 09, 2021 11:23 pm
- Contact:
-
- Site Admin
- Posts: 9804
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v11.2.3075 :
Yes, it is always allowed to return an int whenever a double is expected. int will be widened to a double automatically.
If you like our products and services, please help us by posting your review here.
-
- Posts: 22
- Joined: Thu Dec 09, 2021 11:23 pm
- Contact:
Re: About Question enthuware.ocpjp.v11.2.3075 :
oh got it thanks.
Who is online
Users browsing this forum: No registered users and 8 guests