0

Why += is different from =+ in java

31st Jan 2018, 6:22 PM
HARSH SAHU
14 Answers
+ 3
ya now I got it thanks jeremy
31st Jan 2018, 6:40 PM
HARSH SAHU
+ 1
=+ doesnt exist as own operator
31st Jan 2018, 6:24 PM
Jeremy
Jeremy - avatar
+ 1
I tried same just now
31st Jan 2018, 6:32 PM
HARSH SAHU
+ 1
yaaa sorry it's y=+ x
31st Jan 2018, 6:33 PM
HARSH SAHU
+ 1
but why answer is 4
31st Jan 2018, 6:35 PM
HARSH SAHU
0
why
31st Jan 2018, 6:24 PM
HARSH SAHU
0
why would it?
31st Jan 2018, 6:26 PM
Jeremy
Jeremy - avatar
0
x=4 and y=8 x =+ y (and come 4)
31st Jan 2018, 6:27 PM
HARSH SAHU
0
it's ans.
31st Jan 2018, 6:28 PM
HARSH SAHU
0
no, x would be 8
31st Jan 2018, 6:29 PM
Jeremy
Jeremy - avatar
0
no answer comes this only
31st Jan 2018, 6:31 PM
HARSH SAHU
0
try it on the code playground...
31st Jan 2018, 6:32 PM
Jeremy
Jeremy - avatar
0
even the code on your profile does it how i said it...
31st Jan 2018, 6:34 PM
Jeremy
Jeremy - avatar
0
int x = 4; int y= 5; y = x; // y is now 4 y = +x; //this is the same the plus is evaluated as the sign of x
31st Jan 2018, 6:37 PM
Jeremy
Jeremy - avatar