Java OCA OCP Practice Question 2000

Question

Which of the wrapper classes have a booleanValue() method?.

Select the one correct answer.

  • (a) All wrapper classes.
  • (b) All wrapper classes except Void.
  • (c) All wrapper classes that also implement the compareTo() method.
  • (d) All wrapper classes extending Number.
  • (e) Only the class Boolean.


(e)

Note

While all numeric wrapper classes have the methods byteValue(), doubleValue(), floatValue(), intValue(), longValue(), and shortValue(), only the Boolean class has the booleanValue() method.

Likewise, only the Character class has the charValue() method.




PreviousNext

Related