What will be the output of the following Java program?
class exception_handling
{
Public static void main(String args[])
{
try
{
int a, b;
b = 0;
a = 5 / b;
System.out.print("A");
}
catch(ArithmeticException e)
{
System.out.print("B");
}
finally
{
System.out.print("C");
}
}
}
Answers
Answered by
5
class displayA implements the interface calculate by doubling the value of item, where as class displayB implements the interface by dividing item by item, therefore variable x of class displayA stores 4 and variable x of class displayB stores 1.
Similar questions
English,
2 months ago
Computer Science,
2 months ago
Hindi,
4 months ago
Science,
10 months ago
Math,
10 months ago