Object Oriented Programming MCQs

Page No. 16

Can constructors be overloaded in derived class?


aYes, always

✖


bYes, if derived class has no constructor

✖


cNo, programmer can’t do it

✖


dNo, never

✓


View Answer No, never

Which among the following best describes constructor overloading?


aDefining one constructor in each class of a program

✖


bDefining more than one constructor in single class

✖


cDefining more than one constructor in single class with different signature

✓


dDefining destructor with each constructor

✖



The destructor can be called before the constructor if required.


aTrue

✖


bFalse

✓


cA & B

✖


d None of these

✖


View Answer False

The destructors ____________


aHave a return type

✖


bMay have a return type

✖


cOf derived classes have return type

✖


dDoesn’t have a return type

✓



The constructor _____________


aHave a return type

✖


bMay have a return type

✖


cOf derived classes have return type

✖


dDoesn’t have a return type

✓



Which among the following is true for destructors?


aDestructors can be overloaded

✖


bDestructors can be define more than one time

✖


cDestructors can’t be overloaded

✓


dDestructors are overloaded in derived classes

✖



If a class have 4 constructors then it must have 4 destructors also.


aTrue

✖


bFalse

✓


cA & B

✖


d None of these

✖


View Answer False

For explicit call _________________


a The destructor must be private

✖


bThe destructor must be public

✓


c The destructor must be protected

✖


dThe destructor must be defined outside the class

✖



Number of destructors called are ____________


aAlways equal to number of constructors called

✓


bAlways less than the number of constructors called

✖


cAlways greater than the number of constructors called

✖


dAlways less than or equal to number of constructors

✖



Destructor calls ________________ (C++)


aAre only implicit

✖


b Are only explicit

✖


c Can be implicit or explicit

✓


dAre made at end of program only

✖



Goto Page No.

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