Table of Contents
Exception Handling in Java: A Comprehensive Guide
🔒 Please log in to unlock this course.
ONLINE CLASSES BY RUMMAN ANSARI
Stuck on a Java Program? Ask Your Doubt Directly
Book a one-to-one session to get your questions answered, or message on WhatsApp for live online classes in Java Programming.
- 1:1 Mentoring
- Doubt Clearing
- Interview Preparation
Related Questions
Question 1
Which of the following Java programs will result in a runtime error, and why? public class…
Locked. Enroll to open this question.
MCQ Section
MCQ 1
Predict the output: public class Test{ public static void main(String args[]){ try{ String arr[] =…
Locked. Enroll to open this MCQ.
MCQ 2
Given the code. What is the result when this program is executed? public class Test{ static int…
Locked. Enroll to open this MCQ.
MCQ 3
What is the output for the below code? import java.io.FileNotFoundException; class A{ public void…
Locked. Enroll to open this MCQ.
MCQ 4
try{ File f = new File("a.txt"); }catch(Exception e){ }catch(IOException io){ } Is this code create…
Locked. Enroll to open this MCQ.
MCQ 5
What will be the result if NullPointerException occurs at line 2? 1. try{ 2. //some code goes here…
Locked. Enroll to open this MCQ.
MCQ 6
public class Test{ public static void main(String args[]){ try{ int a = Integer.parseInt("four"); }…
Locked. Enroll to open this MCQ.
MCQ 7
What will be the result after the class Test execution? class A{ public void doA(){ B b = new B();…
Locked. Enroll to open this MCQ.
MCQ 8
What will be the result after compiling this code? class SuperClass{ public int doIt(String str,…
Locked. Enroll to open this MCQ.
MCQ 9
What will be the output? class MyClass{ public String test(){ try{ System.out.print("One"); return…
Locked. Enroll to open this MCQ.
MCQ 10
What will be the output of the following piece of code: class Person{ public void talk() {} }…
Locked. Enroll to open this MCQ.
MCQ 11
Determine output of the following program code? public class Test{ public static void main(String…
Locked. Enroll to open this MCQ.
MCQ 12
What is the output of the following program code? public class Test{ public static void main(String…
Locked. Enroll to open this MCQ.
MCQ 13
System class is defined in .................
Locked. Enroll to open this MCQ.
MCQ 14
Which of the following blocks execute compulsorily whether an exception is caught or not.
Locked. Enroll to open this MCQ.
MCQ 15
Which keyword is used to specify the exception thrown by the method?
Locked. Enroll to open this MCQ.
MCQ 16
Which of the below statement is/are true about Error? A. An Error is a subclass of Throwable.B. An…
Locked. Enroll to open this MCQ.
MCQ 17
Which keyword is used to explicitly throw an exception?
Locked. Enroll to open this MCQ.
MCQ 18
The class at the top of exception class hierarchy is .................
Locked. Enroll to open this MCQ.
MCQ 19
Which exception is thrown when divide by zero statement executes?
Locked. Enroll to open this MCQ.
MCQ 20
What will be the result of executing the following code? public class Test{ public void divide(int…
Locked. Enroll to open this MCQ.
MCQ 21
Which exception is thrown when an array element is accessed beyond the array size?
Locked. Enroll to open this MCQ.
MCQ 22
What happen in case of multiple catch blocks?
Locked. Enroll to open this MCQ.
MCQ 23
In which of the following package Exception class exist?
Locked. Enroll to open this MCQ.
MCQ 24
Given the following piece of code: class SalaryCalculationException extends Exception{} class…
Locked. Enroll to open this MCQ.
MCQ 25
Exception generated in try block is caught in ........... block.
Locked. Enroll to open this MCQ.
Get Java Programming Language updates by email
Short, practical lessons and course updates from Rumman Ansari. No spam.