Object Oriented Programming MCQs

Page No. 68

Which is the necessary condition to define the base and derived class catch blocks?


aBase class catch should be defined first


bDerived class catch should be defined first


cCatch block for both the classes must not be defined


dCatch block must be defined inside main function



If classes produce some exceptions, then ______________________


a If classes produce some exceptions, then ______________________


bTheir respective catch blocks are not mandatory


cTheir catch blocks should be defined inside main function


dTheir catch blocks must be defined at the end of program



Which among the following handles the undefined class in program?


aClassNotFound


bNoClassException


cClassFoundException


d ClassNotFoundException



If a catch block accepts more than one exceptions then __________________


aThe catch parameters are not final


bThe catch parameters are final


cThe catch parameters are not defined


d The catch parameters are not used



To catch more than one exception in one catch block, how are the exceptions separated in the syntax?


aVertical bar


bHyphen


c Plus


dModulus


View Answer Vertical bar

Since which version of java is multiple exception catch was made possible?


aJava 4


b Java 5


cJava 6


d Java 7


View Answer Java 7

How many catch blocks can a class have?


aOnly 1


b2


c3


dAs many as required


View Answer As many as required

If catching of base class exception is done before derived class in C++ ________________


aIt gives compile time error


bIt doesn’t run the program


cIt may give warning but not error


dIt always gives compile time error



The catching of base class exception ___________________________ in java.


aAfter derived class is not allowed by compiler


bBefore derived class is not allowed by compiler


cBefore derived class is allowed


dAfter derived class can’t be done



If both base and derived class caught exceptions ______________


aThen catch block of derived class must be defined before base class


bThen catch block of base class must be defined before the derived class


cThen catch block of base and derived classes doesn’t matter


dThen catch block of base and derived classes are not mandatory to be defined



Goto Page No.

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