Can we use constructor as a method in Java?

No, you cannot call a constructor from a method. The only place from which you can invoke constructors using “this()” or, “super()” is the first line of another constructor.

Sizin İçin Seçtik  Why do we need a no args constructor?

Leave a Reply

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