File size: 526 Bytes
c574d3a |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
//Program to demonstrate system Exception:
package systemexceptions;
public class dividebyzero {
public static void main(String[] args) {
// TODO code application logic here
int a,b,c;
a=0;
b=5;
try{
c=b/a;
System.out.println("the division is:"+c);
}
catch(ArithmeticException e){
System.out.println("Exception caught!!"+e);
}
finally{
System.out.println("Inside the final block");
}
}
}
|