Calculates the sum of two numbers or identifies a positive number.
expression_1 + expression_2
- In the binary construct, a numeric or string expression.
- In the unary construct, a numeric expression.
- An expression of a type compatible with
The binary operator
+ adds the values of two numeric expressions and returns their numeric sum.
If the two expressions are of type
String, then the result is a new string made by the concatenation of
expression_2, in that sequence.
It operates the same as the operator
+ has higher precedence.
The unary operator
+ returns the numeric value of
expression_1 without change.
Thus, it is frequently known as the identity function in mathematics.
Var sum As Int sum = 5 + 1 sum = 2.0 + 4.0 sum = 2 + 2 + 2
All the above assignment statements give
sum the value 6.