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  How do you do we declare constructor and what is use of declaring a constructor?

Leave a Reply

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