Wednesday, 12 April 2017

q-13 how to throw the exception explicitly?


class Test
{
public static void main(String[] args) {
explicitlyCall();
}
public static  void explicitlyCall()
{
try
{
               ArithmeticException ae=new ArithmeticException("ArithmethicException");
       throw ae;
 }
catch(ArithmeticException ae)
{
ae.printStackTrace();
}

}
}

No comments:

Post a Comment