New course! Every coder should learn Generative AI!
Try a free lesson0
What do the expression 1.0 / 0.0 will return? will it throw Exception? any compile time error?
2 Answers
0
You will get Infinity. If you want to get a DivideByZeroException, do integer math like "10/0".
0
it will return Double.infinity