File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes explain checked and unchecked exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "explain checked and unchecked exception" Watch "explain checked and unchecked exception" New topic

explain checked and unchecked exception


Joined: Apr 28, 2001
Posts: 2
please explain above topics
Cindy Glass
"The Hood"

Joined: Sep 29, 2000
Posts: 8521
The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at "JavaRanch Naming Policy" . We require names to have at least two words (not just letters), separated by a space, and strongly recommend that you use your full real name. We want to get to know you as a Professional. Please choose a new name which meets the requirements and re-register.


"JavaRanch, where the deer and the Certified play" - David O'Meara
Nathan Pruett

Joined: Oct 18, 2000
Posts: 4121


The simplest explanation is that checked exceptions are checked for by the compiler... the compiler makes sure that you either put something that will throw these exceptions inside a try...catch block, or that you make the method that contains them propegate the exception upwards. Unchecked exceptions require neither of these and so are not checked for by the compiler. All unchecked exceptions inherit from RuntimeException, so if you look at RuntimeException in the API, you can see a listing of all the "official" unchecked exceptions if you see what extends RuntimeException.


P.S. - Listen to Cindy and use your real name from now on, please!

Write once, run anywhere, because there's nowhere to hide! - /. A.C.
manish paliwal

Joined: May 18, 2001
Posts: 16
in simple words checked exception r that exception that r checked by compiler and unchecked exception is checked by runtime
manish paliwal(or just mann )

manish paliwal(or just mann )
I agree. Here's the link:
subject: explain checked and unchecked exception
It's not a secret anymore!