How constructor is useful for setting initial values for certain member variables? | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
0

How constructor is useful for setting initial values for certain member variables?

25th Sep 2020, 9:01 AM
Atharva Yadav 10th A
Atharva Yadav 10th A - avatar
2 Réponses
+ 9
Constructors are called everytime when a new object is created . passing arguments you can initialize property in class.
25th Sep 2020, 9:38 AM
TOLUENE
TOLUENE - avatar
0
25th Sep 2020, 9:42 AM
Ipang