How mentioning multiple arithmetic operations in two operands works in Java

I have an expression in my code -
int i = 10 + + 11 - - 12 + + 13 - - 14 + + 15;
The value of the variable "i" is evaluated as 75, which is the sum of all the integers mentioned in the expression. How is the assessment going in this scenario?

+6
source share
2 answers

it is rated as

 int i = 10 + (+ 11) - (- 12) + (+ 13) - (- 14) + (+ 15); 

rate

 int i= 10 +11+12+13+14+15; 

and everyone becomes +, so the value is 75.note - - is +

+10
source

First, the entire unary operator will be checked. Example: - - 10 = +10.

Rest, you can appreciate now.

0
source

All Articles