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



What is Exception handling in Java How do you handle run time errors please explain with an examp..

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

What is Exception handling in Java How do you handle run time errors please explain with an examp..

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

Post New Answer

More Core Java Interview Questions

Diff between C++ and java?

9 Answers   TCS,


What is the most important feature of java? What is an interface?

0 Answers  


How to Sort list of Strings in ascending order without using java api.

1 Answers   HCL, NIIT,


What is super keyword explain with example?

0 Answers  


what is main difference b/w abstract class and interface

4 Answers  






What is the final class?

0 Answers  


Does set allows null in java?

0 Answers  


Is java developer a good career?

0 Answers  


What is the difference between panel and frame ?

7 Answers   HCL, IBM, Raim Techno Solutions,


When wait(), notify(), notifyall() methods are called does it releases the lock or holds the acquired lock?

0 Answers  


System.out & System.in are final static data member of System class but we can change there reference through setOut() & setIn() method how...

2 Answers   FCS, TCS,


A non-static inner class may have object instances that are associated with instances of the class’s outer class. A static inner class does not have any object instances.

0 Answers  


Categories