Object Oriented Programming MCQs

Page No. 73

Which symbol should be used to pass the object by reference in C++?


a&


b @


c$


d$ or &


View Answer &

The object ________________


aCan be passed by reference


bCan be passed by value


cCan be passed by reference or value


d Can be passed with reference



Passing object to a function _______________


aCan be done only in one way


bCan be done in more than one ways


cIs not possible


dIs not possible in OOP



Why temporary object is not created in return by reference?


aBecause compiler can’t create temporary objects


bBecause the temporary object is created within the function


cBecause return by reference just make the objects points to values memory location


dBecause return by reference just make the object point to null



If an object is being returned by value then __________________________


aIts member values are made constant


bIts member values have to be copied individually


cIts member values are not used


d Its member values are copied using copy constructor



If an object is passed by reference to a function then it must be returned by reference.


a True


bFalse


cA & B


d None of the above


View Answer False

Can we return an array of objects?


aYes, always


b Ye, only if objects are having same values


cNo, because objects contain many other values


d No, because objects are single entity


View Answer Yes, always

If object is passed by reference ____________________


aTemporary object is created


b Temporary object is created inside the function


cTemporary object is created for few seconds


dTemporary object is not created



Which error will be produced if a local object is returned by reference outside a function?


a Out of memory error


bRun time error


cCompile time error


dNo error


View Answer Compile time error

How many independent objects can be returned at same time from a function?


a1


b 2


c3


d4


View Answer 1

Goto Page No.

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