C Discussion Question at least 6 sentences Is it always nec

C ++ Discussion Question (at least 6 sentences):

Is it always necessary to provide a default constructor for a class? Why or why not?

Solution

Generally a constructor is a special method present under each and every class responsible for initializing the variables of a class.The name of the construtor method will excatly be the same name of the class and moreover it is a non-value returning method.

It is not necessary to provide a default construtor the default construtor gets created whenever we create a class. We can also create explicit construtor in a class.These constructor are mandatory for every class and without constructor under the class we can never create the instance of the class.

C ++ Discussion Question (at least 6 sentences): Is it always necessary to provide a default constructor for a class? Why or why not?SolutionGenerally a constru

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site