class Inc{ public static void main(String args[]){ int a1, b1, a2, b2; a1 = 0; a2 =0; b1 = ++a1; b2 = a2++; System.out.println(a1+" "+b1); System.out.println(a2+" "+b2); } } Output is : 1 1 1 0 pre-increment (++a) is done before the operation, post-increment (a++) after. Java is fundamentally flawed in doing what it says it will, rather than the opposite ;-)Received on Wednesday, 13 December 2000 09:36:45 GMT
This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 9 April 2012 12:13:34 GMT