English

Differentiate Between Constructor and Function. - Computer Applications

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

Englishहिंदीमराठी


      Forgot password?
Use app×