program in Java to implement exception handling

PRINCIPLES OF PROGRAMING LANGUAGES

PRACT. Write a program in Java to implement exception handling. 
public class JavaExceptionExample{
  public static void main(String args[])
  {
   int a = 10;
   try
   {
      int z= a/0;
   }

   catch(ArithmeticException e)
   {
       System.out.println(e);}
   }
  }
EasyExamNotes © 2023