0

Why this value of x after this code = 7 , I am not understand

int x=0; try { x/=0; x+=1; } catch (exception e) { x+=3; } finally { x+=4; }

10th Apr 2017, 9:49 PM
shihab mohamed mansour
shihab mohamed mansour - avatar
6 odpowiedzi
+ 13
try dividing 0 by 0? Mind blown So screw that, i am going to add x by 3. Finally, I am going to add x by 4. So now what is x?
10th Apr 2017, 9:54 PM
Wen Qin
Wen Qin - avatar
+ 5
7
9th Dec 2019, 3:21 PM
Hari Om
Hari Om - avatar
+ 1
answer 7
10th Jan 2020, 7:21 AM
Đào Ngọc Tuấn Anh
Đào Ngọc Tuấn Anh - avatar
+ 1
answer is 7 not 4
28th Jun 2020, 2:35 PM
Frederick John Suerte
Frederick John Suerte - avatar
0
Answer 4
28th Mar 2019, 5:03 AM
Sridhar Raj.P
Sridhar Raj.P - avatar
- 1
thank you i understand now :)
10th Apr 2017, 10:01 PM
shihab mohamed mansour
shihab mohamed mansour - avatar