import java.util.*; public class UnaryPlusMinus { void test() { int x = 0; if (x == 0) { } x += 1; if (x == 1) { } x++; if (x == 3) { } ++x; if (x == 3) {} if (--x == 2) {} x--; if (x == 1) {} } void testChar() { char c = 0; if (--c == '\uFFFF') {} } void testLong() { long l = Integer.MAX_VALUE; l++; if (l == Integer.MAX_VALUE+1L) {} } void testDouble() { double x = 0; x++; if (x == 1) {} x = 1e15; x++; if (x == 1e15) {} } void testArray() { int[] x = new int[3]; int index = 0; x[index++] = 1; x[index++] = 2; x[index++] = 3; x[index++] = 4; } int testInForCondition(int[] _data, int _pos) { int max = _data[_pos - 1]; for (int i = _pos - 1; i-- > 0;) { max = Math.max(max, _data[_pos]); } return max; } void testNotComplexInLoop() { int x = 0; while(true) { int y = x + 1; if (y > 10000) break; x = y; } System.out.println(x); } }