
Exception Handling and CollectionQuiz

Quiz
•
Computers
•
University
•
Hard
Ms. Asst.Prof
Used 3+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which class acts as a root for all java classes?
String
Object
Throwable
None of the above
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is not a kind of exception that is thrown by the JDBC method?
DataRounding
SQL Exception
DataTruncation
SQL Warning
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
None
4.
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 fine but throws ArrayIndexOutOfBoundsException
Compiles and runs fine
Compiles fine but throws ArithmeticException exception
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
The closest common ancestor of RuntimeException, Error, IOException and ClassNotFoundException is:
Object
Exception
Throwable
Catchable
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following statements is true about Java's finally block?
The finally block is only executed if an exception is thrown in the try block
The finally block is only executed if an exception is thrown in the catch block
The finally block is only executed if an exception is not thrown in the try or catch block
The finally block is executed regardless of whether an exception is thrown in the try or catch block
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which interface provides key-value pair?
List
Set
Map
Collection
Create a free account and access millions of resources
Similar Resources on Wayground
10 questions
Topic2: If method

Quiz
•
University
10 questions
exception

Quiz
•
University
15 questions
Python Basics

Quiz
•
KG - University
12 questions
Quiz 9: Pointer

Quiz
•
University
10 questions
Array in C

Quiz
•
University
10 questions
Arrays

Quiz
•
11th Grade - University
13 questions
C programming-1

Quiz
•
University
15 questions
Java Method

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