
Exception Handling

Quiz
•
Computers
•
University
•
Hard
SAKTHI IT-HICET
Used 11+ times
FREE Resource
53 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
When does Exceptions in Java arises in code sequence?
Run Time
Compilation Time
Can Occur Any Time
None of the mentioned
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of these keywords is not a part of exception handling?
try
finally
thrown
catch
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Predict the output of following Java program
class Main {
public static void main(String args[]) {
try {
throw 10;
}
catch(int e) {
System.out.println("Got the Exception " + e);
}
}
}
Got the Exception 10
Got the Exception 0
Compiler Error
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
class Test extends Exception { }
class Main {
public static void main(String args[]) {
try {
throw new Test();
}
catch(Test t) {
System.out.println("Got the Test Exception");
}
finally {
System.out.println("Inside finally block ");
}
}
}
Got the Test Exception
Inside finally block
Got the Test Exception
Inside finally block
Compiler Error
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Output of following Java program?
class Main {
public static void main(String args[]) {
int x = 0;
int y = 10;
int z = y/x;
}
}
Compiler Error
Compiles and runs fine
Compiles fine but throws ArithmeticException exception
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
class Test
{
public static void main (String[] args)
{
try
{
int a = 0;
System.out.println ("a = " + a);
int b = 20 / a;
System.out.println ("b = " + b);
}
catch(ArithmeticException e)
{
System.out.println ("Divide by zero error");
}
finally
{
System.out.println ("inside the finally block");
}
}
}
Compile error
Divide by zero error
a = 0
Divide by zero error
inside the finally block
a = 0
inside the finally block
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of these is a super class of all errors and exceptions in the Java language?
RunTimeExceptions
Throwable
Catchable
None of the above
Create a free account and access millions of resources
Similar Resources on Wayground
50 questions
Java Programming Quiz

Quiz
•
University
55 questions
SAINS KOMPUTER TINGKATAN 4

Quiz
•
12th Grade - University
50 questions
Java Test6

Quiz
•
University
50 questions
Uji Kemampuan Java

Quiz
•
University
50 questions
Quiz Python

Quiz
•
University
54 questions
Python тест

Quiz
•
University
55 questions
Arnaiz Mod. Prelim Exam Java and MySQL

Quiz
•
University
50 questions
FT1 - App

Quiz
•
University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)

Quiz
•
8th Grade - University
7 questions
Force and Motion

Interactive video
•
4th Grade - University
36 questions
Unit 5 Key Terms

Quiz
•
11th Grade - University
7 questions
Figurative Language: Idioms, Similes, and Metaphors

Interactive video
•
4th Grade - University
15 questions
Properties of Equality

Quiz
•
8th Grade - University
38 questions
WH - Unit 3 Exam Review*

Quiz
•
10th Grade - University
21 questions
Advise vs. Advice

Quiz
•
6th Grade - University
12 questions
Reading a ruler!

Quiz
•
9th Grade - University