Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is data type modifier?

931


What does ide stand for?

937


Give differences between Quicksort & Mergesort. When should these sorts be used and what is their running time?

1062


What is variable in java?

977


Make a data structure and implement an algorithm to print all the files in a directory. (The root directory can have sub-directories too.)

1322


What is a percentage sign called?

1108


Can we use catch statement for checked exceptions when there is no chance of raising exception in our code?

1027


What is memory leak and how does java handle it?

972


What is null data type?

1086


What is meant by data hiding in java?

1134


Can we have static methods in an interface?

1038


Is singleton thread safe in java?

962


Can we inherit inner class?

1004


Why put method is idempotent?

904


What is floor in java?

1034