Object Oriented Programming MCQs

Page No. 75

If more than one object refer to the same address, any changes made __________


aCan be made visible to specific objects


bWill be specific to one object only


cFrom any object will be visible in all


dDoesn’t changes the values of all objects



Use of assignment operator ____________________


aChanges its use, when used at declaration and in normal assignment


bDoesn’t changes its use, whatever the syntax might be


cAssignment takes place in declaration and assignment syntax


dDoesn’t work in normal syntax, but only with declaration



How many objects can be assigned to a single address?


aOnly 1


bAt most 7


cAt most 3


dAs many as required


View Answer As many as required

In copy constructor definition, if non const values are accepted only ________


aOnly const objects will be accepted


bOnly const objects will be accepted


cOnly const members will not get copied


d Compiler generates an error



Declaring a copy constructor doesn’t suppresses the compiler generated copy assignment operator.


aTrue


b False


cA & B


d None of the above


View Answer True

If programmer doesn’t define any copy assignment operator then ____________________


aCompiler gives an error


bProgram fails at run time


cCompiler gives an implicit definition


dCompiler can’t copy the member values



Predict the output of the program.


a10


b 20


c 21


d 0


View Answer 20

How the argument passed to a function get initialized?


aAssigned using copy constructor at time of passing


bCopied directly


cUses addresses always


dDoesn’t get initialized



If an object is created and another object is assigned to it, then ________________


aCopy constructor is called to copy the values


bObject is copied directly to the object


cReference to another object is created


dThe new object is initialized to null values



When value of an object is assigned to another object ________________


aIt becomes invalid statement


bIts values gets copied into another object


cIts values gets address of the existing values


dThe compiler doesn’t execute that statement



Goto Page No.

Page 75 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