Java OCA OCP Practice Question 2002

Question

Which statements are true about wrapper classes?.

Select the two correct answers.

  • (a) String is a wrapper class.
  • (b) Double has a compareTo() method.
  • (c) Character has a intValue() method.
  • (d) Byte extends Number.


(b) and (d)

Note

String is not a wrapper class.

All wrapper classes except Boolean and Void have a compareTo() method.

Only the numeric wrapper classes have an intValue() method.

The Byte class, like all other numeric wrapper classes, extends the Number class.




PreviousNext

Related