hello guys, could someone please explain what does this sign “+=” means in java ?
for example :
z += 5.6
thanks in advance.
Sign Up to our social questions and Answers to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers to ask questions, answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Hi Olivier,
it common that z += 5.6 are equivalent to z = z + 5.6, it’s one the assignment operators it takes the value of z then add 5.6 to it and at the end store the new result into z
ex:
but be careful in java because if “z” is not of type double you will get an compilation error.
hope this help.