Object Oriented Programming MCQs

Page No. 66

Which type of member functions get inherited in the same specifier in which the inheritance is done? (If private inheritance is used, those become private and if public used, those become public)


aPrivate member functions


bProtected member functions


cPublic member functions


d All member functions



Which among the following is true for public member functions?


aPublic member functions doesn’t have a return type


bPublic member functions doesn’t have any security


cPublic member functions are declared outside the class


dPublic member functions can be called using object of class



What are public member functions?


a Functions accessible outside the class but not in derived class


b Functions accessible outside the class directly


cFunctions accessible everywhere using object of class


dFunctions that can’t be accessed outside the class



Why do we use finally block?


a To execute the block if exception occurred


bTo execute a code when exception is not occurred


cTo execute a code whenever required


d To execute a code with each and every run of program



Which class is used to handle the input and output exceptions?


aInputOutput


bInputOutputExceptions


cIOExceptions


dExceptionsIO


View Answer IOExceptions

Which symbol should be used to separate the type of exception handler classes in a single catch block?


a?


b,


c


d|


View Answer |

Multiple catch blocks __________________


aAre mandatory for each try block


bCan be combined into a single catch block


cAre not possible for a try block


dCan never be associated with a single try block



To catch the exceptions ___________________


aAn object must be created to catch the exception


bA variable should be created to catch the exception


cAn array should be created to catch all the exceptions


dA string have to be created to store the exception



Which among the following is not a method of Throwable class?


apublic String getMessage()


bpublic Throwable getCause()


cpublic Char toString()


d public void printStackTrace()



How many catch blocks can a single try block can have?


aOnly 1


bOnly 2


cMaximum 127


dAs many as required


View Answer As many as required

Goto Page No.

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