System.out.println (x ++);
System.out.println (x);
will display the number 5 and then the number 6.
Instructions System.out.println (++ x) makes the first is incremented value of the variable x and then this value is read and displayed. Instructions System.out.println (x ++) has the semantics, the first is taken and displayed value of the variable x, and then this value is incremented.