Exception Handling

Exception Handling Overview

try{
read the data
load file
}
catch(FileNotFoundException ex){
use local file and continue
}

Checked and Unchecked Exceptions

Class Test{
psvm(String[] args){
PrintWriter pw = new PrintWriter("abc.txt");
pw.print("Hello")
}
}

Fully and Partially Checked Exceptions

Methods to print Exception

Exceptional Handling pre-defined java classes

Exceptional handling best practices

Special feature

try{
//code}
catch(IOException|SQLException ex){
ex.printStackTrace();
}

Ways of using try catch and finally blocks

Top 10 Exceptions

Try with Resources

throws keyword