Nguyễn Thu Trang
New member
What will be the output of the following Java program?
A. A
B. 0
C. 0A
D. Exception
Code:
class exception_handling
{
static void throwexception() throws ArithmeticException
{
System.out.print("0");
throw new ArithmeticException ("Exception");
}
public static void main(String args[])
{
try
{
throwexception();
}
catch (ArithmeticException e)
{
System.out.println("A");
}
}
}
B. 0
C. 0A
D. Exception