java - What is the difference between a += b and a =+ b , also a++ and ++a? -


as mentioned in title,

what difference between += b , =+ b , a++ , ++a ? i'm little confused

a += b equivalent a = + b

a = +b equivalent a = b

a++ , ++a both increment a 1. difference a++ returns value of a before increment whereas ++a returns value after increment.

that is:

a = 10; b = ++a; //a = 11, b = 11  = 10; b = a++; //a = 11, b = 10 

Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -