Problem 1
- Test level
- Multiple choice
- No calculator
- 4 pts
The following complete source is accepted by the compiler. What is the correct outcome category when it runs?
public class Task {
public static void main(String[] args) {
int divider = 0;
System.out.println(9 / divider);
}
}
Answer
Execution stops with an ArithmeticException before println completes.
Full solution
divider is an initialized int with value 0, so the source is type-correct.
Evaluating 9 / divider attempts integer division by zero before println receives a value.
Execution throws ArithmeticException and produces no completed output line.
Where students lose points
A legal variable declaration does not make every later arithmetic operation defined.

