JAVA Programming :: Basic Concepts - Discussion
Home > JAVA Programming > Basic Concepts > MCQs Questions Discussion
18 / 64
What exception type does the following program throw?
public class Test {
public static void main(String[] args) {
System.out.println(1/0);
}
}
public class Test {
public static void main(String[] args) {
System.out.println(1/0);
}
}
AArithmeticException
BArrayIndexOutOfBoundException
C0
DNo Exception
Answer: Option (Login/Signup)
Show Explanation
Asked In ::
STEP-BY-STEP
Practically, any number divided by zero is not possible.
The above code generates an exception, saying Exception in thread "main" java.lang.ArithmeticException: / by zero at Test.main(Test.java:3).
Read Full Answer
Report Error
Please Login First Click Here