0
What's the difference between a function and an object constructor?
2 Respuestas
+ 2
not realy
constructor is a special function of class definition.
the constructor is automaticly called when you create a new instance of this object (defined by the class)
some language require constructor in all (java) class, other, support an implicit constructor (you don't need to define)(php, python)
0
Constructors are functions that always run when the object, in this matter the class, is created. The functions run when it is called.