Operator Example Result
+ (Unary) +3 int value 3.
+ (Binary) 2 + 4 6.
- (Unary) -x The sign of x is changed.
- (Binary) 4 - 2 2.
++ (Prefix) x = 3 x is 4 and y is 4
y = ++x
++ (Postfix) x = 3 x is 4 and y is 3.
y = x++;
-- (Prefix) x = 3 x is 2 and y is 2.
y = --x
-- (Postfix) x = 3 x is 2 and y is 3.
y = x--
* 4 * 3 12
/ 11 / 4 2
% 11 % 4 3
+(String) "ab" + "cd" "abcd"
|