0

Could you explain the result of this code in java?

x=4; y=2; System.out.print(x++*y--);

20th Jun 2018, 10:53 PM
Caty Zurano
Caty Zurano - avatar
3 odpowiedzi
+ 1
x is 4, y is 2 and you print the product of (x++) and (y--) and the result is 4*2=8 post- increment takes effect after the line on which it takes place
21st Jun 2018, 12:08 AM
Billy Tsouvalas
+ 2
Billy Tsouvalas thank you for that explanation
21st Jun 2018, 12:09 AM
Dlite
Dlite - avatar
0
thank you😀😀
21st Jun 2018, 1:35 AM
Caty Zurano
Caty Zurano - avatar