English

Differentiate Between Constructor and Function.

Advertisements

Question

Differentiate between constructor and function.

Distinguish Between
Advertisements

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?
2016-2017 (March) Set 1
Advertisements
Share
Notifications



      Forgot password?
Use app×