Object Oriented Programming MCQs

Page No. 55

The abstract methods can never be ___________ in a base class.


aPrivate

✓


bProtected

✖


cPublic

✖


dDefault

✖


View Answer Private

If a class have all the abstract methods the class will be known as ___________


aAbstract class

✓


bAnonymous class

✖


cBase class

✖


dDerived class

✖


View Answer Abstract class

Which among the following is correct for abstract methods?


aIt must have different prototype in the derived class

✖


b It must have same prototype in both base and derived class

✓


cIt must have different signature in derived class

✖


dIt must have same return type only

✖



Static methods can’t be made abstract in java.


aTrue

✓


bFalse

✖


cA & B

✖


d None of the above

✖


View Answer True

If a function declared as abstract in base class doesn’t have to be defined in derived class then ______


aDerived class must define the function anyhow

✖


bDerived class should be made abstract class

✓


c Derived class should not derive from that base class

✖


dDerived class should not use that function

✖



What is the syntax for using abstract method?


aabstractmethod_name (parameter)

✓


babsmethod name (parameter)

✖


cabstract return-type method name (parameter)

✖


d abstract method name (parameter)

✖



What is this feature of enforcing definitions of abstract function at compile time called?


aStatic polymorphism

✖


bPolymorphism

✖


c Dynamic polymorphism

✓


dStatic or dynamic according to need

✖



The abstract function definitions in derived classes is enforced at _________


aRuntime

✖


bCompile time

✓


cWriting code time

✖


d Interpreting time

✖


View Answer Compile time

It is ____________________ to define the abstract functions.


aMandatory for all the classes in program

✖


bNecessary for all the base classes

✖


cNecessary for all the derived classes

✓


dNot mandatory for all the derived classes

✖



How are abstract functions different from the abstract functions?


aAbstract must not be defined in base class whereas virtual function can be defined

✓


bEither of those must be defined in base class

✖


cDifferent according to definition

✖


dAbstract functions are faster

✖



Goto Page No.

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