0

What's the difference between a function and an object constructor?

17th Nov 2016, 11:04 PM
Michael Diehl
Michael Diehl - avatar
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)
17th Nov 2016, 11:35 PM
Benjamin Touchard
0
Constructors are functions that always run when the object, in this matter the class, is created. The functions run when it is called.
18th Nov 2016, 4:56 PM
meceware