Java OCA OCP Practice Question 1998

Question

Which of these classes have a one-parameter constructor taking a string?.

Select the two correct answers.

  • (a) Void
  • (b) Integer
  • (c) Boolean
  • (d) Character
  • (e) Object


(b) and (c)

Note

All instances of wrapper classes except Void and Character have a constructor that accepts a string parameter.

The class Object has only a default constructor.




PreviousNext

Related