public class WhoaWhat { public static void main(String[] args) { System.out.println(doOne() + " " + doTwo()); // will print 2048 4 - but why? } private static int doOne() { int result = 2; for(int i = 0; i < 10; i++) { result = result * 2; } return result; } private static int doTwo() { int result = 2; for(int i = 0; i < 10; i++); { result = result * 2; } return result; } }