double d = 5.0 / 0;
System.out.println(d);What is printed?
- Acheck_circle
Infinity
- B
0.0
- C
Error
- D
NaN
Explanation
Division of a non-zero double by zero produces positive Infinity (no exception is thrown for floating-point division by zero).
AP Computer Science A· difficulty 4/5
double d = 5.0 / 0;
System.out.println(d);What is printed?
Infinity
0.0
Error
NaN
Explanation
Division of a non-zero double by zero produces positive Infinity (no exception is thrown for floating-point division by zero).
Want 10 more like this — adaptive to your weak spots?