+ 1

is it must to create a constructor in a class?can there be a program without constructor in a class?

20th Mar 2018, 2:16 AM
abishek samuel
abishek samuel - avatar
2 Answers
+ 11
In most programming languages, a default constructor is prepared, if you do not explicitly define a constructor for the class.
20th Mar 2018, 2:22 AM
Hatsy Rei
Hatsy Rei - avatar
+ 5
I think understanding constructors is very important if you want to understand why Object Oriented Programming is so powerful. Constructors are in my opinion worth spending time with until you understand them.
22nd Mar 2018, 10:27 AM
‎‏‎‏‎Joe
‎‏‎‏‎Joe - avatar