public class Operators { static int i = 0; public static boolean sideEffect(boolean b) { ++i; return b; } public static void main(String[] args) { System.out.println(i++); System.out.println(++i); System.out.println(i--); i = ~i >>> 30; System.out.println(i); System.out.println(i & 7); System.out.println(i | 7); System.out.println(i ^ 7); if (sideEffect(true) || sideEffect(false)) i *= 2; System.out.println(i); if (sideEffect(true) && sideEffect(false)) i %= 3; System.out.println(i); i = sideEffect(i % 2 == 0) ? i << 2 : --i; System.out.println(i); } }