A constructor is a special method (function) of a class that helps to create an object. As its name indicates it constructs the new object.