Java OCA OCP Practice Question 1992

Question

Which of the following are wrapper classes?.

Select the three correct answers.

  • (a) java.lang.Void
  • (b) java.lang.Int
  • (c) java.lang.Boolean
  • (d) java.lang.Long
  • (e) java.lang.String


(a), (c), and (d)

Note

The class java.lang.Void is considered a wrapper class, although it does not wrap any value.

There is no class named java.lang.Int, but there is a wrapper class named java.lang.Integer.

A class named java.lang.String also exists, but it is not a wrapper class since all strings in Java are objects.




PreviousNext

Related