Object Oriented Programming MCQs

Page No. 17

The destructors _____________________


aCan have maximum one argument

✖


bCan’t have any argument

✓


c Can have more than one argument

✖


dCan’t have more than 3 arguments

✖



What is the sequence of destructors call?


a Same order as that of the constructors call

✖


bRandom order

✖


c According to the priority

✖


d) Revere of the order of constructor call

✓



Which among the following is correct syntax for the destructors?


aclassname()

✖


b()classname

✖


cclassname()

✓


d-classname()

✖


View Answer classname()

Which among the following represents correct constructor?


a()classname

✖


b ~classname()

✖


c–classname()

✖


d classname()

✓


View Answer classname()

Which among the following best describes destructor?


aA function which is called just before the objects are destroyed

✓


bA function which is called after each reference to the object

✖


cA function which is called after termination of the program

✖


dA function which is called before calling any member function

✖



Which among the following best describes the constructors?


a A function which is called whenever an object is referenced

✖


b A function which is called whenever an object is created to initialize the members

✓


cA function which is called whenever an object is assigned to copy the values

✖


dA function which is called whenever an object is to be given values for members

✖



What happens when an object is passed by reference?


aDestructor is not called

✓


bDestructor is called at end of function

✖


cDestructor is called when function is out of scope

✖


dDestructor is called when called explicitly

✖



When an object is passed to a function, its copy is made in the function and then ______________


aThe destructor of the copy is called when function is returned

✓


bThe destructor is never called in this case

✖


cThe destructor is called but it is always implicit

✖


dThe destructor must be user defined

✖



Which class destructor will be called first, when following code go out of scope?


a~A()

✖


b~B()

✖


c~C()

✓


d~B() and ~C()

✖


View Answer ~C()

Which among the following is correct for the destructors concept?


a Destructors can be overloaded

✖


bDestructors can have only one parameter at maximum

✖


cDestructors are always called after object goes out of scope

✖


dThere can be only one destructor in a class

✓



Goto Page No.

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