public class Exercise6c { public static class NotFoundException extends Exception { } // returns first position in a at which x occurs // (throws exception, if there is no such position) public static int search(int[] a, int x) throws NotFoundException { int n = a.length; for (int i=0; i