Object Oriented Programming MCQs

Page No. 76

References to object are same as pointers of object.


aTrue


b False


cA & B


d None of the above


View Answer False

What should be done to prevent changes that may be made to the values pointed by the pointer?


aUsual pointer can’t change the values pointed


bPointer should be made virtual


cPointer should be made anonymous


dPointer should be made const



How can the address stored in the pointer be retrieved?


a Using * symbol


bUsing $ symbol


cUsing & symbol


dUsing @ symbol


View Answer Using & symbol

If a pointer to an object is created and the object gets deleted without using the pointer then __________


a It becomes void pointer


bIt becomes dangling pointer


c It becomes null pointer


dIt becomes zero pointer



Which is the correct syntax to call a member function using pointer?


apointer->function()


b pointer.function()


c pointer::function()


dpointer:function()


View Answer pointer->function()

Is name of an array of objects is also a pointer to object?


aYes, always


b Yes, in few cases


cNo, because it represents more than one object


dNo, never


View Answer Yes, always

Can pointers to object access the private members of the class?


aYes, always


bYes, only if it is only pointer to object


cNo, because objects can be referenced from another objects too


dNo, never


View Answer No, never

Pointer to a base class can be initialized with the address of derived class, because of _________


aderived-to-base implicit conversion for pointers


b base-to-derived implicit conversion for pointers


cbase-to-base implicit conversion for pointers


d derived-to-derived implicit conversion for pointers



A pointer _________________


aCan point to only one object at a time


bCan point to more than one objects at a time


cCan point to only 2 objects at a time


d Can point to whole class objects at a time



What is the size of an object pointer?


aEqual to size of any usual pointer


b Equal to size of sum of all the members of object


cEqual to size of maximum sized member of object


d Equal to size of void



Goto Page No.

Page 76 of 93

Alphabetical MCQs Categories

Here below You find all kind of categories of MCQs in alphabetical order.


"Comprehensive Collection of MCQs: Alphabetically Organized by Subject"

"Discover an extensive collection of multiple-choice questions (MCQs) neatly categorized by subject from A to Z. This resource is designed for anyone eager to explore various topics in a straightforward and organized manner. Whether you're a student preparing for exams, an educator seeking supplementary materials, or simply curious about different subjects, this compilation offers a convenient way to learn and assess your knowledge. With questions arranged alphabetically, navigation is effortless, allowing you to delve into subjects of interest at your own pace. Engage, learn, and expand your understanding with this accessible and comprehensive repository of MCQs!"


BolPakistan

bolpakistan.com.pk includes Job Mcqs and Pak Mcqs is the Top Largest Mcqs Forum in World, in which you can read Mcqs of All Subjects, PPSC test preparation, FPSC, NTS and PPSC PAST PAPERS, PPSC PAST MCQS. A Collection of Repeated MCQs for JOBs seekers.

Copyright © 2024, Designed & Developed by BolPakistan