I have a question regarding the following code snippet solution on page 59 ( ch 2):
int x = 3;
int y = ++x * 5 / x-- + --x ;
System.out.println( "x is" +x );
System.out.println( "y is" +y );
According to table 2.1 Order of precedence, post-unary operators are applied first, followed by pre-unary.
But in the above example, the first x with pre-unary operator is incremented and returned to the expression.
What am i missing here? Can someone point me in the right direction please.
a fool thinks himself to be wise, but a wise man knows himself to be a fool - shakespeare. foolish tiny ad:
global solutions you can do in your home or backyard