Oracle
1Z0-819 · Question #123
1Z0-819 Question #123: Real Exam Question with Answer & Explanation
Sign in or unlock 1Z0-819 to reveal the answer and full explanation for question #123. The question stem and answer options stay visible for context.
Question
Given: public class Test{
private int num = 1;
private int div = 0;
public void divide() {
try {
num = num / div;
System.out.print("Exception");
}
catch (ArithmeticException ae) { num = 100; }
catch(Exception e) { num = 200; }
finally { num = 300; }
System.out.print(num);
}
public static void main(String args[]) {
Test test = new Test();
test.divide();
}
}
What is the output?
Options
- A300
- BException
- C200
- D100
Unlock 1Z0-819 to see the answer
You've previewed enough free 1Z0-819 questions. Unlock 1Z0-819 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.