The Rational class in this chapter is defined as a subclass of java.lang.Number. Which of the following expressions is correct?
a. Rational.doubleValue();
b. Rational.doubleValue("5/4");
c. new Rational(5, 4).doubleValue();
d. new Rational(5, 4).toDoubleValue();
e. new Rational(5, 4).intValue();
ce A is wrong, because the doubleValue() method is an instance method. B is wrong for two reasons: 1 . the doubleValue() method is an instance method; 2 . the doubleValue() method does not have arguments. D is wrong becasue there is no method named toDoubleValue().
You might also like to view...
When the ________/Hide button is active, nonprinting characters are visible on the screen
Fill in the blank(s) with correct word
________ options are the settings that are in effect when an application is installed. Spelling and grammar checker as active is one example of this
Fill in the blank(s) with correct word