Go to Top

Friday, 14 October 2011

Try Catch Exception

Demonstrating Try Catch Exception block.

Java Program :

class try_catch
{
 static void print()
 {
     double a;
     try
     {
         a=10/0;
     }
     catch(Exception e)
     {
         System.out.print("Error : "+e);
     }
    }
}

No comments:

Post a Comment

ShareThis