About Question enthuware.ocpjp.v11.2.3075 :

Help and support on OCA OCP Java Programmer Certification Questions
1Z0-808, 1Z0-809, 1Z0-815, 1Z0-816, 1Z0-817

Moderator: admin

Post Reply
yuir12
Posts: 22
Joined: Thu Dec 09, 2021 11:23 pm
Contact:

About Question enthuware.ocpjp.v11.2.3075 :

Post by yuir12 »

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.

admin
Site Admin
Posts: 10023
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.ocpjp.v11.2.3075 :

Post by admin »

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.

yuir12
Posts: 22
Joined: Thu Dec 09, 2021 11:23 pm
Contact:

Re: About Question enthuware.ocpjp.v11.2.3075 :

Post by yuir12 »

oh got it thanks.

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 3 guests