MCQOPTIONS
Saved Bookmarks
This section includes 5 Mcqs, each offering curated multiple-choice questions to sharpen your Technical MCQs knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
Which of the following remarks about the differences between constructors and destructors are correct ? |
| A. | Constructors can take arguments but destructors cannot. |
| B. | Constructors can be overloaded but destructors cannot be overloaded. |
| C. | Destructors can take arguments but constructors cannot. |
| D. | Both A and B |
| E. | |
| Answer» E. | |
| 2. |
An _________ with a constructor or destructor cannot be used as a member or a union |
| A. | Class |
| B. | Object |
| C. | Function. |
| D. | Varible |
| Answer» C. Function. | |
| 3. |
Whenever const objects try to invoke non-const member functions, the compiler ________ |
| A. | Return zero value |
| B. | Return Null |
| C. | Generate error |
| D. | Return no Value |
| Answer» D. Return no Value | |
| 4. |
constructor _______ to allow different approaches of object construction |
| A. | Cannot overloaded |
| B. | Can be overloaded |
| C. | Can be called |
| D. | Can be nested |
| Answer» C. Can be called | |
| 5. |
We must use initializer list in a constructor when |
| A. | There is a reference variable in class |
| B. | There is a constant variable in class |
| C. | There is an object of another class. And the other class doesn't have default constructor |
| D. | All of the above |
| Answer» E. | |