A)
class A {
void x() throws ArithmeticException
// here “throws ArithmeticException” is exception specification.
// ArithmeticException is unchecked exception. Even though it is not handled in
// y() method. It is not raised error in compile time.
{
int a=1;
int b=0;
int c;
c=a/b;
System.out.println(c);
}
void y()
{
x();
}
}
Answer: Nothing wrong.
Comments
Post a Comment