Anu Reddy

Greenhorn
+ Follow
since Feb 05, 2019
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Anu Reddy

Hi,

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.

Thanks!