/* StepByStep.java CIS 160 David Klick 2004-08-28 Demonstrates use of pre and post increment and decrement operators. */ public class StepByStep { public static void main(String[] args) { int n = 5; System.out.println("5 = " + n); n = 5; System.out.println("++5 = " + ++n); n = 5; System.out.println("5++ = " + n++); n = 5; System.out.println("--5 = " + --n); n = 5; System.out.println("5-- = " + n--); } } /* Sample from one run of program: 5 = 5 ++5 = 6 5++ = 5 --5 = 4 5-- = 5 */