Constructor Chaining in Java — this() and super()
Fast recall
Quick revision
Core answer
this() (sibling) or super() (parent) as its first statement — compiler inserts super() if you write neither. this() = telescoping constructors, centralizes init logic. super() = structural, always chains up to Object(). this() and super() mutually exclusive per constructor. Init order: static blocks → parent constructor complete → child instance initializers + body.Whether the candidate understands how constructors chain through this() and super(), and can trace the initialization order in a class hierarchy — parent constructor runs fully before child constructor body
Not understanding that every constructor eventually calls super() — either explicitly or via compiler insertion. Thinking this() and super() can both appear in the same constructor. Not knowing the initialization order: static blocks → parent constructor → instance initializers → child constructor body
Trace a complete initialization sequence through a hierarchy showing the exact order. Explain that this() is a DRY tool for telescoping constructors, while super() is a structural requirement of the language — every object starts as an Object
Interview-ready guide
Interview answer
Constructor chaining is the rule that every Java constructor must call either this() (a sibling constructor in the same class) or super() (the parent constructor) as its very first action. Write neither, and the compiler inserts super() automatically. This means every new Dog("Rex") silently triggers a chain all the way up to Object() before a single line of Dog's body executes.
`this()` — the DRY constructor:
- The telescoping pattern uses
this()to build a hierarchy of constructors — the no-arg constructor delegates to the one-arg, which delegates to the full constructor where all the validation and defaults live - Adding a new parameter later means touching only the full constructor — the shorter delegating constructors keep working automatically without any changes
- Every
this()chain must eventually terminate in a constructor that callssuper(); otherwise the parent would never be initialized
`super()` — the initialization requirement:
- The parent's fields must be fully set up before the child can safely use any inherited state — this is why the parent constructor always runs before the child's body
- When you omit
super(), the compiler insertssuper()automatically — if the parent has no no-arg constructor, you get a compile error on a line you never wrote, pointing at the child class, not the parent - Write
super(args)explicitly when the parent requires arguments; it documents the relationship and prevents surprises
Initialization order:
- Static initializer blocks run once when the class is first loaded, before any instance is created
- Then: parent instance initializers and parent constructor body execute fully
- Then: child instance initializers and child constructor body execute
- The gotcha interviewers test: if a parent constructor calls an overridden method, the child's override runs during parent construction — but the child's fields haven't been initialized yet, so they're at their zero defaults
I recommend this() telescoping to centralize defaults and validation, and switching to the Builder pattern when the number of constructor parameters exceeds four or five.
Constructor Chaining in Java — this() and super()
Direct Answer
Every constructor calls this() (sibling) or super() (parent) as its first statement — compiler inserts super() if you write neither. this() = telescoping constructors, centralizes init logic. super() = structural, always chains up to Object(). this() and super() mutually exclusive per constructor. Init order: static blocks → parent constructor complete → child instance initializers + body.
Common Mistakes & Pitfalls
Not understanding that every constructor eventually calls super() — either explicitly or via compiler insertion. Thinking this() and super() can both appear in the same constructor. Not knowing the initialization order: static blocks → parent constructor → instance initializers → child constructor body
Check your understanding
Answer these without looking back at the article.
- What is the exact initialization order when you create a new object in a class hierarchy?
- If you define a class with no constructors at all, what does the compiler generate?
- Why can't both this() and super() appear in the same constructor body?
- What happens if the parent class has no no-arg constructor and the child omits the super() call?
- When would you replace telescoping constructors with the Builder pattern?
Related interview prep categories
1Looking for a structured roadmap?
Every module on this page is also part of the full Java backend interview track.