This is a discussion on Checked and UnChecked Exception within the Java Programming forums, part of the Software Development category; What are Checked and UnChecked Exception?...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
|
#1
| |||
| |||
| What are Checked and UnChecked Exception? |
|
#2
| |||
| |||
| A checked exception is some subclass of Exception (or Exception itself), excluding class RuntimeException and its subclasses. Making an exception checked forces client programmers to deal with the possibility that the exception will be thrown. eg, IOException thrown by java.io.FileInputStream's read() method· Unchecked exceptions are RuntimeException and any of its subclasses. Class Error and its subclasses also are unchecked. With an unchecked exception, however, the compiler doesn't force client programmers either to catch the exception or declare it in a throws clause. In fact, client programmers may not even know that the exception could be thrown. eg, StringIndexOutOfBoundsException thrown by String's charAt() method· Checked exceptions must be caught at compile time. Runtime exceptions do not need to be. Errors often cannot be. |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| count the time in seconds that a checkbox is really checked | itbarota | HTML, CSS and Javascript Coding Techniques | 1 | 02-13-2008 09:16 PM |
| How can I ensure that one radio button is checked and that the relevant text field is | itbarota | HTML, CSS and Javascript Coding Techniques | 1 | 10-17-2007 10:21 PM |
| When should u use a checked & unchecked exception in java? | H2o | Java Programming | 1 | 07-24-2007 02:47 AM |
| How to postback the checkbox value in treeview when each time it is checked ? | bluesky | ASP and ASP.NET Programming | 0 | 07-15-2007 11:24 PM |
Our Partners |