Halley Thomas wrote:Which is better?
a+=b;
or
a=a+b;
Can you please explain why also?
As far as I've found out and understood...
While incrementing by a variable as above... They are both same.
But if you are incrementing by some constant value say 1 like this :
i = i + 1;
and
i += 1;
Then the later one is more efficient...
This can be explained by using javap command..
javap -c <class name>