Solved

What Is the Difference Between the Result of the Following

Question 92

Multiple Choice

What is the difference between the result of the following two Java statements?
I. int cents = (int) (100 * price + 0.5) ;
II. int cents = (100 * price + 0.5) ;


A) Statement I causes truncation, but II does not
B) Statement II causes truncation, but I does not
C) Statement I compiles, but II does not
D) Statement II compiles, but I does not

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions