A constructor is a special method for initializing a new instance of a class.
The constructor method for a class will have the same name as that of a class.
A class may have multiple constructors in which, each constructor will have the same name, but will have different arguments.
There is no need of calling a constructor, It will evoke automatically when an Object of the class is created.
Asked In: Many Interviews |