// // what is happening here? // public class Inc { public static void main(String[] args) { boolean bug = args[0].equals("bug"); int[] A = new int[]{3,7,0,2,6,1,5,4}; int i = 0; int n = 8; for (int j=0;j<24;j++){ System.out.println("A["+ i +"] = "+ A[i]); if (bug) i = (i++) % n; // (1) this causes a big else i = (i+1) % n; // (2) this is okay } } } // // Attempt to treat array A as circular and scan over 3 // times, looking at 8 array elements 3 times // // Run as follows: // > java Inc bug // > java Inc noBug //