Hello,
I have been trying to figure out why my code won't compile. Any help and advice would be appreciated. Thank you!
I keep getting the following error message:
cannot find symbol -- method PrintIn(java.lang.String) with the following line highlighted:
System.out.printIn("Found " + i + " at " +
Here is the whole code:
public class BinarySearch { public static final int NOT_FOUND = -1; public static int binarySearch (Integer[] a, int x) { int low=0; int high = a.length - 1; int mid; while (low <=high) { mid = (low + high) / 2; if (a[mid].compareTo(x)<0) low = mid + 1; else if (a[mid].compareTo(x) > 0) high = mid - 1; else return mid; } return NOT_FOUND; } public static void main(String[] args) { int SIZE = 8; Integer[] a = new Integer[ SIZE ]; for (int i=0; i<SIZE; i++) a[i] = new Integer(i * 2); for (int i=0; i<SIZE*2; i++) System.out.printIn("Found " + i + " at " + binarySearch(a, new Integer(i))); } }