Page 811 - AP Computer Science A, 7th edition
P. 811

15. (D) None of the constructors in the Rational class takes a real-valued parameter. Thus, the real-valued parameter in choice D will need to be converted to an integer. Since in general truncating a real value to an integer involves a loss of precision, it is not done automatically—you have to do it explicitly with a cast. Omitting the cast causes a compile-time error.


































































































   809   810   811   812   813