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);
}
}
}
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