What is a constructor? ??
Answers
Answered by
1
Answer:
In class-based object-oriented programming, a constructor (abbreviation: ctor) is a special type of subroutine called to create an object. It prepares the new object for use, often accepting arguments that the constructor uses to set required member variables.
Answered by
3
Answer:
- A constructor is methods which are used to create an Object of class.
There are two types of constructor
- Default
- Parameterized constructor.
Similar questions