Constructor
Constructor is a special type of method that is used to initialize the state of an object. Constructor is invoked at the time of object creation. It constructs the values i.e. data for the object that is why it is known as constructor.Constructor is just like method but it does not have any explicit return type.
Rules for creating constructor
There are basically two rules defined for the constructor. 1....