+ 1
No error when dividing by zero
Why is this code not giving any error when I'm dividing my zero? Am I not supposed to get Arithmetic exception? https://code.sololearn.com/cgLJ3oh1AcCQ/?ref=app
1 Réponse
+ 5
For float and double types in Java there are special values like "Infinity". In case of int type it will throw an exception. You can read more here: https://www.geeksforgeeks.org/g-fact-33-infinity-or-exception/. I added on line 7 the result of that division, so you can see it.
https://code.sololearn.com/cgIb3fOnN9ku/?ref=app