How do you call a constructor from a different class?

To call one constructor from another constructor is called constructor chaining in java. This process can be implemented in two ways: Using this() keyword to call the current class constructor within the “same class” . Using super() keyword to call the superclass constructor from the “base class”.

Sizin İçin Seçtik  How do you create an object in C++?

Leave a Reply

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