You can find Exception Handling in Java Examples . In this page you can learn basic concept of Exception Handling Example Program.
class BasicException{
public static void main(String args[]){
int d,a;
try{
d=0;
a=42/d;
System.out.println(“This will not be printed.”);
}
catch(ArithmeticException e){
System.out.println(“Division by zero.”);
}
System.out.println(“After catch statement.”);
}
}
Result:
Division by zero.
After catch statement.
This Java Exception Handling example program is really simple and easy to understand. Can you also provide that how to handle exception handling in real time scenario. Also tell where to use throw and where should we need to use throws keyword in Java Exception Handing.