Practice ยท 2 of 3
Divide, but loudly
Write safeDivide(int a, int b) that returns (double) a / b - but throws ArithmeticException with a message containing "zero" when b is 0. A caller must be able to *catch* the failure, not discover a silent 0.
Difficulty: intermediate
Press Submit to check your solution.
Back to lesson: Practice: Practice: Fail Well