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 function and method in java?
How to Sort Strings which are given in List and display in ascending order without using java api.
Can I use % with real numbers?
What is thread synchronization in java?
Which collections are thread safe in java?
Explain the difference between map and flatmap stream operation?
Mention a package that is used for linked list class in java.
What is included in core java?
How to find the given number is a prime number or not by getting input from the user
Given a singly linked list, how will you print out its contents in the reverse order? Can you do it with consuming any extra space?
What is an example of a boolean?
What is use of super keyword?
Does java linked list allow duplicates?
Explain creating threads by implementing runnable class?
Are arrays immutable in java?