0

Is x++ gives the result x+1 or x always?

30th Dec 2016, 8:27 AM
jakt
jakt - avatar
2 Answers
+ 7
if used alone, yes, it will always operate like ' x = x+1'. But if used in another code like 'System.out.println(x++)' , it will print out the value first, then add x by 1.
30th Dec 2016, 8:39 AM
Wen Qin
Wen Qin - avatar
0
There is no differenece between Postfix operator X++ can also written as X=X+1
30th Dec 2016, 3:53 PM
Taha Mahmood
Taha Mahmood - avatar