How do you call a constructor from another 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 . If you try to invoke constructors explicitly elsewhere, a compile time error will be generated.1 Ağu 2019

Sizin İçin Seçtik  Is Verizon behind on 5G?

Leave a Reply

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