Possible Duplicate:
explain working of post and pre increment operator in Java
What is the difference between int++ and ++int?
In Java, what is ++int
? What does it do? What does it mean?
(Sorry, but I didn't ask the question correctly last time.)
Possible Duplicate:
explain working of post and pre increment operator in Java
What is the difference between int++ and ++int?
In Java, what is ++int
? What does it do? What does it mean?
(Sorry, but I didn't ask the question correctly last time.)
a = 5; b = ++a; // a = 6, b = 6
a = 5; b = a++; // a = 6, b = 5
int a=1;
System.out.println(a++);
prints "1"
int a=1;
System.out.println(++a);
prints "2"
Or maybe i don't understand your question.
++int
increments int by 1 before and int++
increments by one after