a += b
is short-hand for a = a + b
(though note that the expression a
will only be evaluated once.)
a =+ b
is a = (+b)
, i.e. assigning the unary +
of b
to a
.
Examples:
int a = 15;
int b = -5;
a += b; // a is now 10
a =+ b; // a is now -5
More Related Contents:
- Is there a difference between x++ and ++x in java?
- Difference between >>> and >>
- Java: What does ~ mean
- What is the difference between += and =+?
- Java Illegal start type ) expected [closed]
- how to define a constructor outside class in java?
- Java: How to write a condition for operators? [closed]
- Why don’t Java’s +=, -=, *=, /= compound assignment operators require casting?
- What is the Java ?: operator called and what does it do?
- Why is “extends T” allowed but not “implements T”?
- What is a Question Mark “?” and Colon “:” Operator Used for? [duplicate]
- Java: Syntax and meaning behind “[B@1ef9157”? Binary/Address?
- Is there a difference between single and double quotes in Java?
- Java for loop syntax: “for (T obj : objects)”
- WITH statement in Java
- Is it possible to make anonymous inner classes in Java static?
- Java “?” Operator for checking null – What is it? (Not Ternary!)
- Any Java libraries out there that validate SQL syntax? [closed]
- Labeled Statement block in Java?
- Modifier Keyword order in Java
- Why is this Java code in curly braces ({}) outside of a method?
- ^ operator in java [duplicate]
- XML syntax validation in Java [closed]
- What’s the difference between this and Activity.this
- In Java, how do I access the outer class when I’m not in the inner class?
- Creating the instance of abstract class or anonymous class
- Converting decimal to binary in Java
- What do < and > mean such as implements Comparable?
- Why don’t Java’s +=, -=, *=, /= compound assignment operators require casting long to int?
- Comparing float and double primitives in Java