In C Choose the best completion of the following sentence Wh

In C++

Choose the best completion of the following sentence.

When you define a class, a default constructor will be automatically provided by the compiler….

Answer

a) Unless you define any constructors that take parameters.

b) Unless you define any constructors.

c) Always.

d) Unless you define a default constructor.

Solution

When you define a class, a default constructor will be automatically provided by the compiler

a)UNLESS you define any constructors that take parameters. (ANS)

NOTE: For information the answer holds true untill the parameters don\'t have some default value i.e if parameters are default arguments then default constructor will again be provided by compiler

In C++ Choose the best completion of the following sentence. When you define a class, a default constructor will be automatically provided by the compiler…. Ans

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site