- From: Danny Ayers <danny@panlanka.net>
- Date: Wed, 13 Dec 2000 20:36:14 +0600
- To: "John Philip Anderson" <jpanderson_215@hotmail.com>, <cwturner@cycom.co.uk>
- Cc: <www-jigsaw@w3.org>
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 UTC