+ 1
explain the output of java code
int x = 5; System.out.println((i++)+(++i));
3 Answers
+ 3
Here i++ will be 5 before incrementing by 1
here ++i will be 7 because after doing operation on i++ , i will be 6 so ++i will be 7
So finally
5 + 7 = 12
+ 1
🦋FEATHER🦋 i++ first assign the value then increment i by 1 and ++i first increment value by 1 then assign so here should be
5 + 7 = 12;
0
++ means increment of 1
There for technically it's like:
System.out.println((6)+(6));
Therefore output : 12



