
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
Java Arrays

Quiz
•
University
9 questions
Scratch Vocabulary

Quiz
•
3rd Grade - University
10 questions
Python Programming Quiz

Quiz
•
University
10 questions
Java quiz 1

Quiz
•
University
10 questions
Java Quiz 1

Quiz
•
University
13 questions
Java Practice Quiz on Exception Handling

Quiz
•
University
10 questions
BCSC0006 - Quiz 1 - Arrays

Quiz
•
University
15 questions
Bootcamp Day 3 - Java Array

Quiz
•
University
Popular Resources on Wayground
15 questions
Hersheys' Travels Quiz (AM)

Quiz
•
6th - 8th Grade
20 questions
PBIS-HGMS

Quiz
•
6th - 8th Grade
30 questions
Lufkin Road Middle School Student Handbook & Policies Assessment

Quiz
•
7th Grade
20 questions
Multiplication Facts

Quiz
•
3rd Grade
17 questions
MIXED Factoring Review

Quiz
•
KG - University
10 questions
Laws of Exponents

Quiz
•
9th Grade
10 questions
Characterization

Quiz
•
3rd - 7th Grade
10 questions
Multiply Fractions

Quiz
•
6th Grade