+ 12

Which error occurs?

int a=5/0; is this a logical or runtime error (in JDK8)?

22nd Sep 2018, 4:39 PM
Navoneel
7 odpowiedzi
+ 8
From Wikipedia: The infinities of the extended real number line can be represented in IEEE floating point datatypes, just like ordinary floating point values like 1, 1.5 etc. They are not error values in any way, though they are often (but not always, as it depends on the rounding) used as replacement values when there is an overflow. Upon a divide by zero exception, a positive or negative infinity is returned as an exact result.
23rd Sep 2018, 10:24 AM
Vishnu
Vishnu - avatar
22nd Sep 2018, 4:41 PM
Scooby
Scooby - avatar
+ 4
it will show an Arithmetic exception error
24th Sep 2018, 4:05 PM
Purab Gupta
Purab Gupta - avatar
+ 3
This is due to the fact that division by zero is a syntax error..
23rd Sep 2018, 3:19 AM
José Alejandro Moreno
+ 2
it throws ArithmeticException
23rd Sep 2018, 6:16 PM
Sharofiddin
Sharofiddin - avatar
+ 1
I think this is logical error and in program we can handle this type of errors through exception handling concept in java
23rd Sep 2018, 2:17 PM
Pooja Bele
Pooja Bele - avatar
- 1
/ not allowed assigning integers
23rd Sep 2018, 3:28 PM
Luis Roman
Luis Roman - avatar