Advertisements
Advertisements
Question
Differentiate between constructor and function.
Distinguish Between
Solution
Constructors must be named with the same name as the class name. They cannot return anything, even void (the object itself is the implicit return).
Functions must be declared to return something, although it can be void.
shaalaa.com
Is there an error in this question or solution?