When does Exceptions in Java arises in code sequence?

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
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 Quizizz
50 questions
PF201: SCCPF2012223

Quiz
•
University
50 questions
Dasar Pemrograman Java

Quiz
•
University
50 questions
FINAL TEST FOR JAVA PROGRAMMING 2

Quiz
•
University
50 questions
Java Array Questions

Quiz
•
University
50 questions
Java Programming Quiz 2-6

Quiz
•
University
48 questions
สอบปลายภาค วิชาจาวาเว็บ

Quiz
•
University
51 questions
Advanced Java Programming FSD1

Quiz
•
University
52 questions
ICT CBP Q3 Periodical Test

Quiz
•
9th Grade - University
Popular Resources on Quizizz
15 questions
Multiplication Facts

Quiz
•
4th Grade
20 questions
Math Review - Grade 6

Quiz
•
6th Grade
20 questions
math review

Quiz
•
4th Grade
5 questions
capitalization in sentences

Quiz
•
5th - 8th Grade
10 questions
Juneteenth History and Significance

Interactive video
•
5th - 8th Grade
15 questions
Adding and Subtracting Fractions

Quiz
•
5th Grade
10 questions
R2H Day One Internship Expectation Review Guidelines

Quiz
•
Professional Development
12 questions
Dividing Fractions

Quiz
•
6th Grade