| Claim | Verdict |
|---|
| A constructor is a method with a special name | False. It has no return type, so it is not a method. |
| A constructor must return the object | False.new yields the reference, not the constructor. |
| The default constructor always exists | False. Only when you declare no constructor. |
| Constructors are inherited | False. Each class declares its own. |
| A constructor can be static or final | False. Both are compile errors. |
| Overriding a parent constructor is allowed | False. Constructors are never overridden. |
| You may call super after other statements | False. It must be the first statement. |
| Instance blocks run after the constructor body | False. They run before it. |
Frequently Asked Questions
Why does a constructor not have a return type?
Because Java identifies constructors by structure rather than by a keyword. A member whose name matches the class and which declares no return type is a constructor, invoked by new. Adding void, even once, converts it into an ordinary method returning nothing, and the class then silently has no constructor with that signature.
Can a constructor be static, final, or abstract?
No, all three are compile errors. A constructor belongs to a specific object being created, so static makes no sense. It is never inherited, so final is meaningless. And an abstract constructor would have nothing to initialise, since an abstract class cannot be instantiated anyway.
What happens if I declare one parameterized constructor?
The compiler stops generating a default constructor, so new ClassName() no longer compiles. This frequently breaks code in a different file that never mentioned your change, which is why declaring an explicit no-argument constructor alongside your parameterized ones is a common defensive habit.
Are constructors inherited by subclasses?
No. Every class declares its own constructors. A subclass must invoke a parent constructor explicitly with super, or the compiler inserts a call to the parent no-argument constructor. If the parent has only parameterized constructors, omitting super is a compile error.
When do instance initializer blocks run?
After fields are given their default values but before the constructor body runs, in textual order alongside field initialisers. So a block that reads a field sees the default value, not one assigned in the constructor, which is why assigning fields inside a block is almost always a mistake.
What is the difference between a default and a no-argument constructor?
The default constructor is generated by the compiler and exists only when you declare no constructor, doing nothing beyond leaving fields at their defaults. A no-argument constructor is one you write explicitly, and writing it deliberately lets you validate state or provide sensible defaults that the generated one would not.
Can I call this and super in the same constructor?
No. Because both must be the first statement, only one can occupy that position. Use this to delegate to another constructor of the same class, and super to invoke a parent constructor, and pick the one that matches what you need.
Do constructors get overloaded by return type or access modifier?
They cannot be overloaded by return type, because constructors have none, and they cannot differ only by access modifier, since that would give them the same signature. Overloading a constructor works by varying the parameter list, exactly as it does for methods.