+ 2
Constructors are automatically called when you create an object. You don't need to use it manually or can't access by object. It's used to create an object.
20th Jan 2022, 2:54 PM
Jayakrishna 🇼🇳
+ 2
We don't "use" the constructor, the `new` operator does, during the instantiation of an object of the class, to setup the new instance. Didn't get what you mean by "to access it using object". Constructor is a special method that doesn't return anything, not even callable.
20th Jan 2022, 2:52 PM
Ipang
0
In C++ a structure can have constructor & destructor just like a class.
20th Jan 2022, 3:17 PM
Ipang