Object Oriented Programming MCQs

Page No. 51

If one class have derived the base class privately then another class can’t derive the base class publically.


aTrue


bFalse


cA & B


d None of the above


View Answer False

How many classes can be derived from the base class using hierarchical inheritance? a) As many as required


aAs many as required


bOnly 7


cOnly 3


dUp to 127


View Answer As many as required

Which among the following is correct for following code?


aCompile time error


b Runtime error


cProgram runs and o/p is 0


dProgram runs and o/p is garbage value


View Answer Compile time error

Which class uses hierarchical inheritance in following code?


aClass A, B, C


b Class B, C, D


cClass A, C, D


dClass D, A, B


View Answer Class D, A, B

Which access specifiers should be used so that all the derived classes restrict further inheritance of base class members?


aPrivate


bPublic


cProtected


d Any inheritance type can be used


View Answer Private

Base class _______________


aCan be made abstract


bCan’t be made abstract


cMust be abstract


dIf made abstract, compile time error


View Answer Can be made abstract

How many classes must be there to implement hierarchical inheritance?


a Exactly 3


b At least 3


cAt most 3


dAt least 1


View Answer At least 3

Each class can inherit the base class ________________


aIndependently using any inheritance


b Independently with private inheritance only


cWith same type of inheritance


dWith each class using different inheritance only



Do members of base class gets divided among all of its child classes?


aYes, equally


bYes, depending on type of inheritance


cNo, it’s doesn’t get divided


dNo, it may or may not get divided



Which among the following is best to define hierarchical inheritance?


aMore than one classes being derived from one class


bMore than 2 classes being derived from single base class


cAt most 2 classes being derived from single base class


dAt most 1 class derived from another class



Goto Page No.

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