Object Oriented Programming MCQs

Page No. 53

If __________________ inheritance is done continuously, it is similar to tree structure.


a Hierarchical


bMultiple


cMultilevel


dHierarchical and Multiple


View Answer Hierarchical

Diamond problem includes ____________________ hybrid inheritance.


a Hierarchical and Multiple


bHierarchical and Hierarchical


cMultiple and Multilevel


dSingle, Hierarchical and Multiple



If single inheritance is used with class A and B. A is base class. Then class C, D and E where C is base class and D is derived from C, then E is derived from D. Class C is made to inherit from class B. Which is the resultant type?


a Single level


b Multilevel


cHybrid


d Multiple


View Answer Multilevel

How many types of inheritance should be used for hybrid?


a Only 1


bAt least 2


cAt most two


d Always more than 2


View Answer At least 2

Which among the following best defines the hybrid inheritance?


aCombination of two or more inheritance types


bCombination of same type of inheritance


c Inheritance of more than 7 classes


dInheritance involving all the types of inheritance



If virtual function of base class is redefined in derived class then ________________


a It must be declared virtual in derived class also


bIt may or may not be declared virtual in derived class


cIt can must not be declared virtual in derived class


dt must be declared normally in derived class



It is __________ to redefine the virtual function in derived class.


aNecessary


bNot necessary


cNot acceptable


dGood practice


View Answer Not necessary

The virtual functions must be declared and defined in _____________ class and overridden in ___________ class.


aBase, base


bDerived, derived


cDerived, base


dBase, derived


View Answer Base, derived

Which among the following is true for virtual functions?


aPrototype must be different in base and derived class


bPrototype must be same in base class and derived class


c Prototype must be given only in base class


dPrototype must have different signature in base and derived class



Which is a must condition for virtual function to achieve runtime polymorphism?


aVirtual function must be accessed with direct name


bVirtual functions must be accessed using base class object


c Virtual function must be accessed using pointer or reference


dVirtual function must be accessed using derived class object only



Goto Page No.

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