Hi Kumar,

An extraction from java tutorial :

Runtime exceptions represent problems that are detected by the runtime
system. This includes arithmetic exceptions (such as when dividing by zero),
pointer exceptions (such as trying to access an object through a null
reference), and indexing exceptions (such as attempting to access an array
element through an index that is too large or too small). 

Runtime exceptions can occur anywhere in a program and in a typical program
can be very numerous. Typically, the cost of checking for runtime exceptions
exceeds the benefit of catching or specifying them. Thus the compiler does
not require that you catch or specify runtime exceptions, although you can. 

Checked exceptions represent useful information about the operation of a
legally specified request that the caller may have had no control over and
that the caller needs to be informed about--for example, the file system is
now full, or the remote end has closed the connection, or the access
privileges don't allow this action. 

What does it buy you if you throw a RuntimeException or create a subclass of
RuntimeException just because you don't want to deal with specifying it?
Simply, you get the ability to throw an exception without specifying that
you do so. In other words, it is a way to avoid documenting the exceptions
that a method can throw. When is this good? Well, when is it ever good to
avoid documenting a method's behavior? The answer is "hardly ever." 


regards
Philip

-----Urspr�ngliche Nachricht-----
Von: Kumar.K.R [mailto:[EMAIL PROTECTED]
Gesendet: Freitag, 28. November 2003 08:46
An: [EMAIL PROTECTED]
Betreff: Checked and Unchecked Exception


What are the differences between checked exceptions and un-checked
exceptions.  Is it that All application exceptions are checked exceptions
and all system exceptions are unchecked exceptions.


Thanx and Regards,

KRKumar

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to