Object Oriented Programming MCQs

Page No. 46

How many types of inheritance are possible in C++?


a2

✖


b3

✖


c4

✖


d5

✓


View Answer 5

If base class contains 2 nested classes, will it be possible to implement single level inheritance?


aYes, always

✓


bYes, only if derived class also have nested classes

✖


cNo, it will use more than 2 classes which is wrong

✖


dNo, never

✖


View Answer Yes, always

Which constructor will be called first from the classes involved in single inheritance from object of derived class?


aBase class constructor

✓


bDerived class constructor

✖


c Both class constructors at a time

✖


duntime error

✖



Single level inheritance will be best for___________


a Inheriting a class which performs all the calculations

✖


b Inheriting a class which can print all the calculation results

✓


c Inheriting a class which can perform and print all calculations

✖


d Inheriting all the classes for different calculations

✖



What is the output of the following program?


aB salary is: 4000.0 Bonus of B is: 10000

✓


bB salary is 10000 Bonus of B is: 4000.0

✖


cCompile time error

✖


dRuntime error

✖



What is the output of the following program?


aGarbage value

✖


bCompile time error

✓


c Runtime error

✖


dRuns but gives random values as output

✖


View Answer Compile time error

Which language doesn’t support single level inheritance?


a Java

✖


b C++

✖


cKotlin

✖


dAll languages support it

✓



Single level inheritance is safer than _____________


aMultiple inheritance

✓


b Interfaces

✖


cImplementations

✖


d Extensions

✖


View Answer Multiple inheritance

Which concept will result in derived class with more features (consider maximum 3 classes)?


aSingle inheritance

✖


bMultiple inheritance

✓


cMultilevel inheritance

✖


dHierarchical inheritance

✖


View Answer Multiple inheritance

Which among the following is false for single level inheritance?


aThere can be more than 2 classes in program to implement single inheritance

✖


bThere can be exactly 2 classes to implement single inheritance in a program

✖


cThere can be more than 2 independent classes involved in single inheritance

✓


dThe derived class must implement all the abstract method if single inheritance is used

✖



Goto Page No.

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