PackageExercise 1;/*** + +--some calculations with ^ *@authorSeeclanukyo **/ Public classTest4 { Public Static voidMain (string[] args) {inti = 3; intb = (i++) + (--)-(++i) + (i++); /*** The first i++ is 3 for + calculation, then 4, the second is to decrement 4 to 3, the third ++i,3 to 4, the fourth i++ at 4 o'clock, and then 5. * * So 3+3-4+4=6*/System.out.println (b); ////////////////////////////// intj = 6; intK = (j + +)-(--) + (i++)-(---j); /*** The first J is calculated at 6 o'clock, then 7 second I at the end of the 5, then-I becomes 4 the third i++ is calculated at 4 o'clock, then becomes 5 fourth--j, becomes 6 * * So 6-4+4-6=0 */System.out.println (k); ////////////////////////////// intQ = 32; intP = 64; intresult =--q + p++-q + p++ + q---Q; /*** 31+64 (+) -31+65 (+31) -30 31+64-31+65+31-30=130*/System.out.println (Result); ////////////////////////////// intx = 6; inty = 9; X= x ^y; Y= x ^y; X= y ^ x ^ x ^y; /*** First get numeric binary 6[0110], 9[1001] <-short first with 4 bit * * x:0110 1001 = 1111 * * y:111 1 1001 = 0110 * * x: * 0110 * 1111 = 1001 * 1111 ^ 1001 = 0110↓* 0110 ^ 0110 = 0000 * * x:0*/System.out.println (x); }}
Afraid of their own forget, paste it!
~~~~~~~~~~~~~~~
java + +,--, prefix suffix expression values, and ^ values are calculated