0
Constructors
what is the use of constructor in simple words
3 Respostas
+ 3
It creates an instance of the object when called. It can be called by simply assigning it to a variable.
imagine you have an object Circle
you can instantiate it by:
Circle C1;
or if you have parameters to create an object with different properties like the radius on the circle:
Circle C1(0.5);
+ 4
Constructor is creating the similar words