/ Published in: Java
Strings are sorted in ascending order.
This was created by me in order to thwart Dr. McCloskey's evil ways of forcing CS majors to manually alphabetize lists of names and months.
Expand |
Embed | Plain Text
import java.util.*; public class SortName{ int i = 0; while(i < num){ names[i] = s.nextLine(); i++; } StringComparator strcomp = new StringComparator(); } } } class StringComparator implements Comparator<String>{ return a.compareTo(b); } }
You need to login to post a comment.
