Object Oriented Programming MCQs

Page No. 49

Which among the following best defines multilevel inheritance?


aA class derived from another derived class

✖


bClasses being derived from other derived classes

✓


c Continuing single level inheritance

✖


dClass which have more than one parent

✖



Can the derived class be made abstract if multiple inheritance is used?


a No, because other classes must be abstract too

✖


b Yes, if all the functions are implemented

✖


cYes, if all the methods are predefined

✖


dNo, since constructors won’t be there

✓



Which members can’t be accessed in derived class in multiple inheritance?


a Private members of base

✓


b Public members of base

✖


c Protected members of base

✖


d All the members of base

✖



If a class contains 2 nested class and is being inherited by another class, will there be any multiple inheritance?


aNo, only single level inheritance is used

✓


bNo, only multilevel inheritance is used

✖


c Yes, because 3 classes are involved

✖


dYes, because more than 1 classes are being derived

✖



Is it compulsory to have constructor for all the classes involved in multiple inheritance?


aYes, always

✖


bYes, only if no abstract class is involved

✓


cNo, only classes being used should have a constructor

✖


dNo, they must not contain constructors

✖



If all the members of all the base classes are private then _____________


aThere won’t be any use of multiple inheritance

✓


bIt will make those members public

✖


cDerived class can still access them in multiple inheritance

✖


d Compile time error

✖



When multiple inheritance is used, which class object should be used in order to access all the available members of parent and derived class?


aDerived class object

✓


b Parent class objects

✖


cUse Abstract derived class

✖


dDerive a class from derived class

✖


View Answer Derived class object

How to overcome diamond problem?


aUsing alias name

✖


bUsing seperate derived class

✖


cUsing virtual keyword with same name function

✓


dCan’t be done

✖



How many base classes can a derived class have which is implementing multiple inheritance?


aOnly 2

✖


bAt least 2

✖


cAt most 2

✖


d As many as required

✓



Why does diamond problem arise due to multiple inheritance?


aMethods with same name creates ambiguity and conflict

✓


b Methods inherited from the superclass may conflict

✖


cDerived class gets overloaded with more than two class methods

✖


dDerived class can’t distinguish the owner class of any derived method

✖



Goto Page No.

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