public class IterationExamples { public IterationExamples() { int n = 4; for (int i=1; i<=n; i+=2) { System.out.println(i); } System.out.println("While loop"); int a = 10; while (a >= 0) { System.out.println(a); a -= 2; } // i *= j + k not the same as i = i * j + k int i = 4, j = 3, k = 2; i *= j + k; System.out.println("i: " + i + ", j: " + j + ", k: " + k); i = 4; j = 3; k = 2; i = i * j + k; System.out.println("i: " + i + ", j: " + j + ", k: " + k); } public static void main(String[] args) { new IterationExamples(); } }