Java MCQ on Exception Handling | Mock Questions on Exception Handling for OCJP


Java multiple choice questions on Exception Handling. Free online self-assessment test on Java Exception Handling concepts. This test has 15 multiple choice questions on java Exception Handling concepts. These mock test series on Java programming language consisting of a wide range of multiple-choice questions are designed to evaluate the self-performance of Java skills. Very useful in interviews and OCJP certification exam preparation.



Java Online Mock OCJP Test Series: 4

Topic- Exception Handling in Java

The test consists of 15 questions.

No negative marking for this test.

No Time limit

The pass percentage is 70%

The correct answer with a description will be displayed after the answer has been marked.

Submit the test to calculate your score once you are done with all the questions.

Complexity Level- Easy





Q1: If exception condition is not handled explicitly in a java program, then in case of occurrence of an exception, the uncaught exception will be handled by















Q2: A checked exception is the one that:

Select the correct answer:














Q3: An unchecked exception is the one that:












Q4: 'finally' block will never execute if the 'catch' block is missing

Select True or false











Q5: A 'try' block can have multiple 'catch' blocks

Select True or false











Q6: A 'try' block can have multiple 'finally' blocks?

Select True or False:











Q7: 'catch' and 'finally' both blocks are necessary following the 'try' block

Select True or False:











Q8: 'try', 'catch', 'finally' construct can be nested in any other 'try' or 'catch' or 'finally' blocks

Select True or False











Q9: 'finally' block will never execute if no exception occurs in the 'try' block

Select True or False











Q 10: 'catch' block gets skipped if no exception occurred in the 'try' block

Select True or False











Q11: 'throw' keyword is used to _______














Q12: 'throws' keyword is used to ______














Q13: All exceptions in java are derived from ________














Q14: Exceptions defined by 'Error' and 'RuntimeException' classes and their subclasses are known as














Q15: What will be the output of the below program:


public class exception_example {

public static void main(String[] args) {
div(4,0);
}

public static void div(int a, int b) {

try
{
int x=(a/b);
System.out.println("x="+x);
}

catch(Exception exp) {
System.out.println("Exception caught in catch-1");
}

catch(ArithmeticException e) {
System.out.println("Exception caught in catch-2");
}

}
}



























Quantitative aptitude - practice tests


A series of aptitude practice tests comprising multiple-choice questions (MCQ) on varied aptitude topics that evaluate the quantitative ability.