Skip to content

Latest commit

 

History

History
25 lines (20 loc) · 548 Bytes

File metadata and controls

25 lines (20 loc) · 548 Bytes

Exception Handling

heirarchy

Rules in Handling Exception :

  1. Exception, Error, RuntimeException and Thowable types can all be thrown using the throw keyword.

  2. Always resist to write a single catchall exception

try {
//some code
} catch (Exception e){
}
  1. Order of catching exceptions : catch bolck of subclasses will be used first, then parent exception class
try{
} catch (FileNotFoundException e){
} catch (IOException e){
} catch (Exception e){
}