What is Exception handling in Java
How do you handle run time errors please explain with an
example
Answer Posted / uv
Exceptions are handled by using "try","catch" and "finally"
block in the program.
The part of code which is suspected to give an exception is
kept under try block.
The exception is then been caught by the "catch" block. In
this way, we can avoid the abnormal termination of the
program and can also display some user friendly messages
which could guide them on how to refrain from exceptions.
finally block contains the code which is necessary to
execute like closing of connections established with
database while running the application.
finally block is always executed irrespective of the
exception.
| Is This Answer Correct ? | 16 Yes | 0 No |
Post New Answer View All Answers
What is http client in java?
What is an array in java?
Are static members inherited to sub classes?
What is static class
How to sort numbers in java without array?
Can we catch more than one exception in a single catch block?
How to perform quicksort in java?
What does localhost mean?
What modifiers may be used with an inner class that is a member of an outer class in java programming?
Break statement can be used as labels in java?
What lambda means?
How do you use spaces in java?
What do you understand by the term wrapper classes?
Is array a class in java?
we have syntax like for(int var : arrayName) this syntax is to find whether a number is in the array or not.but i want to know how to find that number's location.