wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Exception handling Quiz

Total questions: 15

Worksheet time: 8mins

Name
Class
Date
1.

What is the main purpose of exception handling in Java?

A) To improve program speed
B) To avoid compilation errors
C) To handle runtime errors gracefully
D) To reduce memory usage

a)

A

b)

B

c)

C

d)

D

2.

Which block must always follow a try block?

A) finally
B) catch or finally
C) throw
D) throws

a)

A

b)

B

c)

C

d)

D

3.

Which block is executed whether exception occurs or not?

A) try
B) catch
C) finally
D) throw

a)

A

b)

B

c)

C

d)

D

4.

If an exception is caught, which block executes next?

A) Another catch
B) finally
C) try
D) throw

a)

A

b)

B

c)

C

d)

D

5.

Which catch block should be written first?

A) Parent exception
B) Child exception
C) Any order
D) Random order

a)

A

b)

B

c)

C

d)

D

6.

Which keyword is used to explicitly generate an exception?

A) throws
B) throw
C) try
D) catch

a)

A

b)

B

c)

C

d)

D

7.

Which keyword is used in method declaration?

A) throw
B) throws
C) catch
D) finally

a)

A

b)

B

c)

C

d)

D

8.

Which statement is correct?

A) throw is used to handle exception
B) throws is used to declare exception
C) Both are same
D) None

a)

A

b)

B

c)

C

d)

D

9.

How many exceptions can be declared using throws?

A) Only one
B) Only two
C) Multiple
D) None

a)

A

b)

B

c)

C

d)

D

10.

Which is a Checked Exception?

A) NullPointerException
B) ArithmeticException
C) IOException
D) ArrayIndexOutOfBoundsException

a)

A

b)

B

c)

C

d)

D

11.

Which is an Unchecked Exception?

A) SQLException
B) IOException
C) RuntimeException
D) ClassNotFoundException

a)

A

b)

B

c)

C

d)

D

12.

Which superclass handles all exceptions?

A) Error
B) Exception
C) Throwable
D) Object

a)

A

b)

B

c)

C

d)

D

13.

Which of these cannot be caught?

A) Exception
B) Error
C) Throwable
D) RuntimeException

a)

A

b)

B

c)

C

d)

D

14.

Checked exceptions are checked at:

A) Runtime
B) Compile time
C) Execution time
D) Load time

a)

A

b)

B

c)

C

d)

D

15.

Unchecked exceptions belong to:

A) Error class
B) Exception class
C) RuntimeException class
D) Throwable class

a)

A

b)

B

c)

C

d)

D