What happens if a Java class has no constructors defined?

What happens if a Java class has no constructors defined?

  1. A.

    The compiler throws an error

  2. B.

    The compiler adds a default constructor automatically

  3. C.

    A parameterized constructor is added by default

  4. D.

    The object cannot be created using new keyword

  5. E.

    Only static methods can be accessed

Attempted by 243 students.

Sign up free to check your answer

Sign up free

Explore the full course: Isro

Loading lesson…