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

What problems will occur when you don?t use layout managers?

1 Answers  


What is the difference between getCodeBase and getDocumentBase methods?

1 Answers   CS Business Services,


What is the use of accept () method in java?

0 Answers  


What is the advantage of functional interface in java 8?

0 Answers  


How can we find the sum of two linked lists using stack in java?

0 Answers  






What is the name of the java compiler?

0 Answers  


What is the difference between serializable and externalizable interface?

0 Answers  


What do you mean by exception handling in Java?

0 Answers   Atos Origin,


What is Connection pooling? Explain Pros and Cons?

1 Answers  


What technique can be employed to compare two strings?

0 Answers  


Under what conditions is an object’s finalize() method invoked by the garbage collector?

0 Answers  


Can we have more than one package statement in source file ?

0 Answers  


Categories