Java exceptions interview questions
<<Previous Next>>
What is an Exception? Explain by giving
an example.
Exceptions are errors that occur at runtime and disrupt the normal flow of
execution of instructions in a program...............
Read answer
A checked exception is a subclass of Exception excluding class RuntimeException
and its subclasses..............
Read answer
At times, depending on the need of a program, a programmer might need to create
his own set of exceptions. These exceptions are called as the User defined
Exceptions...............
Read
answer
There are 3 ways in which the exceptions are generated: The JVM can generate
exceptions which are beyond the control of the User.................
Read
answer
The try block is the region of code where exceptions can get produced. So most
of the code of execution lies in this region..............
Read
answer
The different ways to use a throw are:.............
Read
answer
When an application responds to an exception by throwing another exception, it
is very useful to know when an exception caused another. Chained Exceptions
help the programmer do this.................
Read
answer
The finally block is the region where the code that needs to be executed under
any circumstance is written. The purpose of this block is usually performing
the clean up activities...........
Read
answer
|