About Question enthuware.ocpjp.v21.2.4033 :

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

Moderator: admin

Post Reply
pablin13
Posts: 5
Joined: Thu Sep 19, 2013 12:35 pm
Contact:

About Question enthuware.ocpjp.v21.2.4033 :

Post by pablin13 »

The given answer in the first option states that the output will be "10.0 10 10", but the correct output is "10.0 10 10.0".

This discrepancy occurs because the variable e is a double, not an int. Specifically, e is assigned the result of mean(d, d), which calls the method:

Code: Select all

double mean(int i, int j) { 
    return Math.sqrt(i * j); 
}
Since d = 10, the method computes:

Code: Select all

Math.sqrt(10 * 10) = 10.0;  // Returns a double

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

Re: About Question enthuware.ocpjp.v21.2.4033 :

Post by admin »

You are right. Fixed.
thank you for your feedback!

Post Reply

Who is online

Users browsing this forum: No registered users and 69 guests