How do you call a constructor from another constructor?

The invocation of one constructor from another constructor within the same class or different class is known as constructor chaining in Java. If we have to call a constructor within the same class, we use ‘this’ keyword and if we want to call it from another class we use the ‘super’ keyword .

Sizin İçin Seçtik  What is a overload constructor?

Leave a Reply

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