Java

Java - Exception Handling(ArithmeticException)

Java - Exception Handling(ArithmeticException)
class ariex1

 {

   public static void main(String arg[])

    {

      try

        {

         int a,b,c;

         a=10; b=0;

         c=a/b;

         System.out.println(c);

        }

         catch(ArithmeticException e)

          {   }

       finally

        {

          System.out.println("\nDivide by zero, change the value..."); 

        }

    }

 }
Senthilvelan Sambamoorthy

Senthilvelan Sambamoorthy is working as a Professor in Department of Master of Computer Applications, Paavai Engineering College, Namakkal, Tamilnadu, India, He is Masters in Computers Applications. Having 18+ years of experience and his area of interest is Java, JSP, Servlet, J2EE, C#, PHP, Python ASP.NET, SQL Server and etc.