194k views
0 votes
What method is known as a class's constructor, because it is run automatically when a user instantiates the class

User Sam Murphy
by
7.6k points

1 Answer

5 votes

A constructor is a special method of a class or structure in object-oriented programming that initializes a newly created object of that type. ... Instead of performing a task by executing code, the constructor initializes the object, and it cannot be static, final, abstract, and synchronized.

User Gabriel Archanjo
by
9.0k points
Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.