In the example on page 557 , why we used a static class to implement Comparator??
The code sample creates an instance of the static member type ReSortComparator within the static context of the main method. A static member type such as ReSortComparator can be created within the context of the main method even though no instance of SearchObjArray exists. If you were to delete the static modifier from the declaration of ReSortComparator, then ResortComparator could not be created within the static context of the main method because an enclosing instance of SearchObjArray would not be available.
If you add the static modifier to the declaration of ReSortComparator, then it will compile.