3 public class WhileArray1 {
4 public static void main(String args[]) {
5 char a[] = new char[10];
6 char b[] = new char[10];
7 for (int i = 0; i < 10; i++) {
8 a[i] = b[i] = (char) i;
10 System.out.printf("success? %d\n", equal(a, b, 5) ? 1 : 0);
12 for (int i = 0; i < 10; i++) {
14 a[i] = (char) (b[i] + 2);
16 System.out.printf("success? %d\n", equal(a, b, 5) ? 1 : 0);
19 public static boolean equal(char[] a, char[] b, int len) {
20 /* stolen from the equals implementation of java.lang.String of
24 System.out.printf("idx: x: %d, y: %d\n", x, y);
25 if (a[x++] != b[y++]) {