Java: Non-static nested classes and instance.super()

It’s called a “qualified superclass constructor invocation”.

Citing from here:

Explicit constructor invocation statements can be divided into two kinds:

  • Alternate constructor invocations begin with the keyword this (possibly prefaced with explicit type arguments). They are used to invoke an alternate constructor of the same class.

  • Superclass constructor invocations begin with either the keyword super (possibly prefaced with explicit type arguments) or a Primary expression. They are used to invoke a constructor of the direct superclass. Superclass constructor invocations may be further subdivided:

  • Unqualified superclass constructor invocations begin with the keyword super (possibly prefaced with explicit type arguments).

  • Qualified superclass constructor invocations begin with a Primary expression . They allow a subclass constructor to explicitly specify the newly created object’s immediately enclosing instance with respect to the direct superclass (ยง8.1.3). This may be necessary when the superclass is an inner class.

Leave a Comment