/* StringSorterLexico.java ** An instance of this class has methods (inherited from its parent) ** by which to sort an array (or a segment thereof) of Strings into ** ascending order. It supplies the body of isLessThan() for the ** purpose of defining/implementing an ordering on strings. Here, ** that is the classic lexicographic ordering, which is what the ** String class's compareTo() method provides. */ public class StringSorterLexico extends StringSorter { /* Returns true iff s1 < s2 according to the String class's ** compareTo() method, which implements lexicographic ordering. */ @Override protected boolean isLessThan(String s1, String s2) { return s1.compareTo(s2) < 0; } }