Java OCA OCP Practice Question 663

Question

Which of the following are true about the "default" constructor?

Select 1 option

  • A. It is provided by the compiler only if the class and any of its super classes does not define any constructor.
  • B. It takes no arguments.
  • C. A default constructor is used to return a default value.
  • D. To define a default constructor, you must use the default keyword.
  • E. It is always public.


Correct Option is  : B

Note

The default constructor is provided by the compiler only when a class does not define ANY constructor explicitly.




PreviousNext

Related