English

What is a constructor? - Computer Science 1

Advertisements
Advertisements

Question

What is a constructor?

Short Answer

Solution

  1. A constructor is a special member function of a class. Its task is to initialize the objects of its class.
  2. It is special because its name is the same as that of the class to which it belongs.
shaalaa.com
  Is there an error in this question or solution?
2023-2024 (March) Official
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×