Why super is first in constructor?

Java enforces that the call to super (explicit or not) must be the first statement in the constructor. This is to prevent the subclass part of the object being initialized prior to the superclass part of the object being initialized .

Sizin İçin Seçtik  Is matic Coin limited?

Leave a Reply

Your email address will not be published. Required fields are marked *

Why super is first in constructor?

Java enforces that the call to super (explicit or not) must be the first statement in the constructor. This is to prevent the subclass part of the object being initialized prior to the superclass part of the object being initialized .

Sizin İçin Seçtik  Is matic Coin limited?

Leave a Reply

Your email address will not be published. Required fields are marked *