Object Oriented Programming MCQs

Page No. 50

If class A inherits class B and class C as “class A: public class B, public class C {// class body ;}; ”, which class constructor will be called first?


aClass A

✖


bClass B

✓


cClass C

✖


dAll together

✖


View Answer Class B

Is it possible to have all the abstract classes as base classes of a derived class from those?


aYes, always

✖


b Yes, only if derived class implements all the methods

✓


cNo, because abstract classes doesn’t have constructors

✖


dNo, never

✖



Which programming language restricts the use of multiple inheritance?


a C++

✖


bPHP

✖


cSmallTalk

✖


dJava

✓


View Answer Java

How many classes should a program contain to implement the multiple inheritance?


aOnly 1

✖


bAt least 1

✖


cAt least 3

✖


dExactly 3

✓


View Answer At least 3

Which problem arises due to multiple inheritance, if hierarchical inheritance is used previously for its base classes?


aDiamond

✓


bCircle

✖


cTriangle

✖


dLoop

✖


View Answer Diamond

Multiple inheritance is ____________________


a When a class is derived from another class

✖


bWhen a class is derived from two or more classes

✓


cWhen a class is derived from other two derived classes

✖


dWhen a class is derived from exactly one class

✖



All the derived classes can access only a few members of base class that other derived classes can’t access at same time, in hierarchical inheritance.


a True

✖


bFalse

✓


cA & B

✖


d None of the above

✖


View Answer False

Which class constructor is called first when an object of derived class is created?


aBase class constructor

✓


bDerived class constructor

✖


c Firstly created derived class constructor

✖


dLast created derived class constructor

✖



Which type of inheritance is most suitable for inheriting Same syllabus into different colleges with different streams?


aMultiple

✖


bSingle

✖


cHierarchical

✓


dMultilevel

✖


View Answer Hierarchical

Hierarchical inheritance can be a subset of _________________


aHybrid inheritance

✓


bMultiple inheritance

✖


c Single level inheritance

✖


dMultilevel inheritance

✖


View Answer Hybrid inheritance

Goto Page No.

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