So it is not mandatory to use a constructor , but if you don’t define one there is a “default constructor that will be created for you. Constructors are functions that initialize the object you have just instantiated which are called automatically when you instantiate an object to use in your program.
Is it mandatory to use constructor?
So it is not mandatory to use a constructor , but if you don’t define one there is a “default constructor that will be created for you. Constructors are functions that initialize the object you have just instantiated which are called automatically when you instantiate an object to use in your program.