What is Exception handling in Java
How do you handle run time errors please explain with an
example
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / edward sudhahar chennai
Exception handling is a mechanism to handle unexpected
situations in java. This avoids the program to be
terminated upnormaly.
| Is This Answer Correct ? | 4 Yes | 0 No |
What modifiers are allowed for methods in an interface?
Can I declare class as static or private?
These static constructors are correct ? class A { statc intA() { } static A(int x,int y) { } static A(int x) { } }
What is dynamic array in java?
In which way does a Primitive data type is passed ?
What does t in java mean?
What is the use of System class?
What is the difference between throw and throws? What is the similarity between try and throw?
How to convert string to int in java?
What is methods and methodology?
what is difference between String buffer and String builder?
what is Remote Reference Layer ?