+ 2
What is a constructor?
3 Answers
+ 7
Constructors are special methods invoked when an object is created and are used to initialize them.
A constructor can be used to provide initial values for object attributes.
- A constructor name must be same as its class name.
- A constructor must have no explicit return type.
+ 1
A constructor is a special method of a class or structure in object-oriented programming that initializes an object of that type. A constructor is an instance method that usually has the same name as the class, and can be used to set the values of the members of an object, either to default or to user-defined values.
0
It is a large flying machine which creates heavy and ugly robots equiped with machine guns and focused in killing you. If you can take control of them, well then you have the upper hand in the battle