Multiple choice technology programming languages

What happens when this is in your code? double x; x=24.0/0;

  1. Compiler Error

  2. Compiles and runs

  3. Runtime Error

  4. None of these

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

In Java, floating-point division by zero produces Infinity (positive or negative) rather than a runtime error. The code compiles successfully and executes without throwing an exception. Division by zero only throws ArithmeticException for integer types (int, long), not floating-point types (float, double).