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
What is the function of internal frame in swing?
Why do we use swing in java?
What is the purpose of action interface in swing?
Which package is needed for swing components?
What is javax swing joptionpane?
What is the mean of swing?
What are the different components that are used to show a container?
What is an event in Swing?
What is a swing application?
What is the difference between invokeAndWait() and invokeLater()?
Why is model-view-controller architecture used in swing?
What is a component in swing?
What is an event and what are the models available for event handling?
am searching for the job based on java, swing, currently working small company. they are not giving any salary slip, offer letter. so if i try outside for MNC's they start with previous company details. what should i do..? please help me to get job and make my career.
What's java swing?