- 1

int a=1,b; b=++a + a++ + ++a + a++; System.out.println(b); System.out.print (a); What is the value of 'a' and 'b' ??

25th Sep 2017, 5:09 PM
Ankit Singh Rawat
Ankit Singh Rawat - avatar
2 odpowiedzi
+ 8
Read this forum concerning Pre and Post incrementation: https://stackoverflow.com/questions/4445706/post-increment-and-pre-increment-concept b = 2 + 2 + 4 + 4 = 12, a = 5
25th Sep 2017, 6:06 PM
LynTon
LynTon - avatar
- 3
A is 5 B is 13
25th Sep 2017, 5:25 PM
Usama Zafar
Usama Zafar - avatar