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
4.2k 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
5.5k points