Both tos++ and ++tos increment the variable they are applied to. The result returned by tos++ is the value of the variable before incrementing, whereas the result returned by ++tos is the value of the variable after the increment is applied.
example:
public class IncrementTest{
public static void main(String[] args){
System.out.println("***Post increment test***");
int n = 10;
System.out.println(n); // output 10
System.out.println(n++); // output 10
System.out.println(n); // output 11
System.out.println("***Pre increment test***");
int m = 10;
System.out.println(m); // output 10
System.out.println(++m); // output 11
System.out.println(m); // output 11
}
}
For more info, read this: http://www.javawithus.com/tutorial/increment-and-decrement-operators Or google post increment and pre increment in java.