Object Oriented Programming MCQs

Page No. 36

It is _________________________ to have an abstract method.


aNot mandatory for an static class


bNot mandatory for a derived class


cNot mandatory for an abstract class


d Not mandatory for parent class



Can abstract classes have static methods (Java)?


aYes, always


bYes, but depends on code


cNo, never


dNo, static members can’t have different values


View Answer Yes, always

Abstract class can’t be final in java.


aTrue


b False


cA & B


d None of the above


View Answer True

The abstract classes in java can _________________


aImplement constructors


bCan’t implement constructor


cCan implement only unimplemented methods


dCan’t implement any type of constructor



Use of pointers or reference to an abstract class gives rise to which among the following feature?


aStatic Polymorphism


bRuntime polymorphism


cCompile time Polymorphism


d Polymorphism within methods


View Answer Runtime polymorphism

Which among the following is an important use of abstract classes?


aHeader files


bClass Libraries


cClass definitions


dClass inheritance


View Answer Class Libraries

We ___________________ to an abstract class.


aCan create pointers


bCan create references


cCan create pointers or references


dCan’t create any reference, pointer or instance



Abstract classes can ____________________ instances.


aNever have


bAlways have


cHave array of


dHave pointer of


View Answer Never have

Abstract class A has 4 virtual functions. Abstract class B defines only 2 of those member functions as it extends class A. Class C extends class B and implements the other two member functions of class A. Choose the correct option below.


aProgram won’t run as all the methods are not defined by B


bProgram won’t run as C is not inheriting A directly


cProgram won’t run as multiple inheritance is used


dProgram runs correctly



If a class is extending/inheriting another abstract class having abstract method, then _______________________


aEither implementation of method or making class abstract is mandatory


bImplementation of the method in derived class is mandatory


cMaking the derived class also abstract is mandatory


dIt’s not mandatory to implement the abstract method of parent class



Goto Page No.

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