What does the Java compiler provide when a class declares no constructors at all?
Correct answer B. A default constructor with no parameters
Explanation
If a class body contains no constructor declarations, the compiler implicitly supplies a default constructor with no parameters that simply calls super(). It has the same access level as the class. Declaring any constructor yourself, even one with parameters, removes this default, which is why code calling new X() can suddenly stop compiling.
Answer checked How we write and check questions
Discussion