PROGRAM-
class ExceptionDem6
{
public
static void main(String args[ ])
{
try
{
int
a=Integer.parseInt(args[0]);
int
b=Integer.parseInt(args[1]);
int
c=a/b;
System.out.println("c=" +c);
}
catch(ArithmeticException
ae)
{
System.out.println("Exception
:"+ae);
}
catch(Exception
e)
{
System.out.println("Other
Exception");
}
}
}
Comments
Post a Comment