The book has an interesting type safety issue. It has headers such as

public static void sort (Comparable [] A)

The problem with this is that Comparable is a generic interface: it's Comparable[T]. If sort is called on elements of type X, where X is

public class X implements Comparable<X>

then we are ok. But if sort is called on elements of type Y, where Y is

public class Y implements Comparable<Z>

then we will get a runtime exception when it tries to compare elements of A to each other, because they aren't comparable to each other.

Of course, it is better to find the bug at compile time (by the programmer) rather than at run time (by the user). To make it so, you should declare sort as follows:

public static <T extends Comparable<T>> void sort(T [] a)

Now it is a generic method, with proper bounds. However, this bound is too restrictive. If class V implements Comparable<V>, and U extends V, you won't be able to sort an array of type U, because you never specified that U implements Comparable<U>, only that U implements Comparable<V>. To fix this, declare as follows:

public static <T extends Comparable<? super T>> void sort(T [] a)