constructor | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
+ 1

constructor

can anyone explain to me exactly how a constructor work.?

6th Apr 2017, 12:34 PM
hmangaiha Pachuau
hmangaiha Pachuau - avatar
1 Réponse
+ 7
Function without a return type but with the same name as the class, which is invoked when an object is created. Used mainly to initialize variables.
6th Apr 2017, 2:07 PM
Pixie
Pixie - avatar