Note: information on this page refers to Ceylon 1.0, not to the current release.
+= (add assign) operator
The right-associative, binary infix
+= operator increments it's left-hand operand
by the amount given by its right-hand operand.
variable Integer num = 1; num += 1; // increment num by 1 num += num; // increment num by 2
The operator is defined as:
lhs = lhs.plus(rhs)
lhs is evaluated only once.
See the language specification for more details.
+= operator is polymorphic.
The definition of the
+= operator depends
The result type of the
+= operator is the same as the type of its right hand operand.