MCQOPTIONS
Saved Bookmarks
This section includes 7 Mcqs, each offering curated multiple-choice questions to sharpen your Object Oriented Programming knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
What will be the output if all necessary code is included (Header files and main function)? |
| A. | Run time error |
| B. | Compile time error |
| C. | Null |
| D. | It is a string |
| Answer» E. | |
| 2. |
Which among the following is correct? |
| A. | Two objects can point to the same memory location |
| B. | Two objects can never point to the same memory location |
| C. | Objects not allowed to point at a location already occupied |
| D. | Objects can’t point to any address |
| Answer» B. Two objects can never point to the same memory location | |
| 3. |
The this pointers _____________________ |
| A. | Are modifiable |
| B. | Can be assigned any value |
| C. | Are made variables |
| D. | Are non-modifiable |
| Answer» E. | |
| 4. |
Pointer to a base class can be initialized with the address of derived class, because of _________ |
| A. | derived-to-base implicit conversion for pointers |
| B. | base-to-derived implicit conversion for pointers |
| C. | base-to-base implicit conversion for pointers |
| D. | derived-to-derived implicit conversion for pointers |
| Answer» B. base-to-derived implicit conversion for pointers | |
| 5. |
Which among the following is true ? |
| A. | We can use direct assignment for any object |
| B. | We can use direct assignment only for different class objects |
| C. | We must not use direct assignment |
| D. | We can use direct assignment to same class objects |
| Answer» E. | |
| 6. |
Predict the output of the program. |
| A. | 10 |
| B. | 20 |
| C. | 21 |
| D. | 0 |
| Answer» C. 21 | |
| 7. |
Which among the following is true ? |
| A. | this pointer is passed implicitly when member functions are called |
| B. | this pointer is passed explicitly when member functions are called |
| C. | this pointer is passed with help of pointer member functions are called |
| D. | this pointer is passed with help of void pointer member functions are called |
| Answer» B. this pointer is passed explicitly when member functions are called | |