JAVA Exceptions
Program Errors Errors Compile Time Errors Run Time Errors Syntex Errors Compiler Version Errors Logical Errors Resource Er...
try..catch block <ul><li>try </li></ul><ul><li>{ </li></ul><ul><li>statements expected to raise exception; </li></ul><ul><...
public interface java.lang.Throwable <ul><li>This abstracts the methods needed to handle exception. </li></ul><ul><li>Meth...
public class java.lang.Exception <ul><li>This is the class that implements Throwable interface. </li></ul><ul><li>This is ...
Some Majorly Used Exceptions java.lang.Exception Java.io.IOException Java.lang.ArrayIndexOutOfBoundsException Java.lang.Nu...
throw and throws keywords <ul><li>throw </li></ul><ul><ul><li>This keyword is used to raise an exception explicitly. </li>...
Upcoming SlideShare
Loading in...5
×

exception handling in java

822

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
822
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
43
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

exception handling in java

  1. 1. JAVA Exceptions
  2. 2. Program Errors Errors Compile Time Errors Run Time Errors Syntex Errors Compiler Version Errors Logical Errors Resource Errors Exceptions
  3. 3. try..catch block <ul><li>try </li></ul><ul><li>{ </li></ul><ul><li>statements expected to raise exception; </li></ul><ul><li>} </li></ul><ul><li>catch(ExceptionType1 object) </li></ul><ul><li>{ </li></ul><ul><li>remedy coed.. </li></ul><ul><li>} </li></ul><ul><li>catch(ExceptionType2 object) </li></ul><ul><li>{ </li></ul><ul><li>remedy code.. </li></ul><ul><li>} </li></ul><ul><li>…………… </li></ul>
  4. 4. public interface java.lang.Throwable <ul><li>This abstracts the methods needed to handle exception. </li></ul><ul><li>Methods (All of The Below Are public abstrract) </li></ul><ul><ul><li>String toString() </li></ul></ul><ul><ul><li>String getMessage() </li></ul></ul>
  5. 5. public class java.lang.Exception <ul><li>This is the class that implements Throwable interface. </li></ul><ul><li>This is the super class for any exception class in java. </li></ul><ul><li>Methods (All of The Below Are public) </li></ul><ul><ul><li>String toString() </li></ul></ul><ul><ul><li>String getMessage() </li></ul></ul>
  6. 6. Some Majorly Used Exceptions java.lang.Exception Java.io.IOException Java.lang.ArrayIndexOutOfBoundsException Java.lang.NumberFormatException Java.lang.ArithmeticException Java.sql.SQLException … And many other
  7. 7. throw and throws keywords <ul><li>throw </li></ul><ul><ul><li>This keyword is used to raise an exception explicitly. </li></ul></ul><ul><ul><li>Generally employed in User Defined Exception Handling </li></ul></ul><ul><li>throws </li></ul><ul><ul><li>This keyword is used to transfer the exception raised in a function to the calling function of the same. </li></ul></ul><ul><ul><li>The function which actually has the exception will not handle it, but the calling function does it. </li></ul></ul>
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×