Multiple choice

Which of the following statements is true in Java?

  1. An object can be a class

  2. A class can be an object

  3. A class must have at least one member function.

  4. If a constructor is not specified, a default constr. is used

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

In Java, if a class does not explicitly define any constructors, the compiler automatically provides a default, no-argument constructor. The other options are incorrect because classes and objects are distinct entities, and classes are not required to have member functions.