Object Oriented Programming MCQs

Page No. 72

In which type is new memory location will be allocated?


aOnly in pass by reference

✖


bOnly in pass by value

✓


cBoth in pass by reference and value

✖


dDepends on the code

✖


View Answer Only in pass by value

What will be the output if all necessary code is included (Header files and main function)?


aRun time error

✖


bCompile time error

✖


c Null

✖


dIt is a string

✓


View Answer It is a string

If the object is not to be passed to any function but the values of the object have to be used then?


a The data members should be passed separately

✓


bThe data members and member functions have to be passed separately

✖


cThe values should be present in other variables

✖


dThe object must be passed

✖



What exactly is passed when an object is passed by reference?


aThe original object name

✖


b The original object class name

✖


c The exact address of the object in memory

✓


d The exact address of data members

✖



Can data members be passed to a function using the object?


aYes, it can be passed only inside class functions

✖


bYes, only if the data members are public and are being passed to a function outside the class

✓


cNo, can’t be passed outside the class

✖


dNo, can’t be done

✖



If an object is passed by value, _________________


a Temporary object is used in the function

✖


bLocal object in the function is used

✓


cOnly the data member values are used

✖


dThe values are accessible from the original object

✖



What is the type of object that should be specified in the argument list?


aFunction name

✖


bObject name itself

✖


cCaller function name

✖


dClass name of object

✓


View Answer Class name of object

Copy constructor definition requires __________________


a Object to be passed by value

✖


bObject not to be passed to it

✖


cObject to be passed by reference

✓


dObject to be passed with each data member value

✖



Pass by reference of an object to a function _______________


aAffects the object in called function only

✖


b Affects the object in prototype only

✖


cAffects the object in caller function

✓


dAffects the object only if mentioned with & symbol with every call

✖



If object is passed by value ______________


aCopy constructor is used to copy the values into another object in the function

✓


bCopy constructor is used to copy the values into temporary object

✖


cReference to the object is used to access the values of the object

✖


dReference to the object is used to created new object in its place

✖



Goto Page No.

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