Exp 11


*********Exception Handling***********

package expt11;

public class exception1 {

                public static void main(String[] args) {
                                // TODO Auto-generated method stub
                                try
                                {
                                                int a=10,b=0;
                                                int c=a/b;
                                }
                                catch(ArithmeticException e)
                                {
                                                System.out.println("Divide by Zero Error");
                                }
                }

}
**OUTPUT**
Divide by Zero Error

Comments