Solved

What Is the Difference Between the Result of the Following

Question 65

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

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents