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 difference between checked and unchecked exception
plz explain examples ?

Answer Posted / rakesh

A checked exception is one, which a block of code is likely
to throw, and represented by throws clause.It represents
invalid conditions in areas outside the immediate control of
the program (invalid user input, database problems, network
outages, absent files).
In Java it is expected that a method 'throws' an exception
which is a checked exception.They are subclasses of Exception.
While unchecked exceptions represent defects in the program
(often invalid arguments passed to a non-private method).
According to definition in The Java Programming Language, by
Gosling, Arnold, and Holmes,"Unchecked runtime exceptions
represent conditions that, generally speaking, reflect
errors in your program's logic and cannot be reasonably
recovered from at run time." They are subclasses of
RuntimeException, and are usually implemented using
IllegalArgumentException, NullPointerException, or
IllegalStateException
It is somewhat confusing, but note as well that
RuntimeException (unchecked) is itself a subclass of
Exception (checked)

Is This Answer Correct ?    31 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to render an html page using only swing.

995


Which method is used by the applet to recognize the height and width?

1093


What is import javax swing * used for?

989


How to reload a jframe in java swing?

1032


What is the base class for all swing components?

1051


What is javax swing joptionpane?

997


What are the differences between Swing and AWT?

1128


What are the components of java swing?

1009


What is java swing package?

959


Write a program to paint the off-screen buffer in swings

1007


What do you mean by java swing?

960


What is the purpose of action interface in swing?

1049


How is multi-threading gets implemented using swing?

971


Why is model-view-controller architecture used in swing?

976


What is the function of abstractaction class?

1063