What is the output of the following
code:
int x = 2;
x +=
x++ * x++ * x++;
System.out.println(x);
I understand that
++variableName
is pre-increment operator and the value of
variableName
is incremented before it is used in the expression
whereas variableName++
increments its value after the
expression is executed. What I want to know is - how does this logic apply
here?
No comments:
Post a Comment