|
|
|
|
|
by jchan
4877 days ago
|
|
Use a Comparator. http://docs.oracle.com/javase/6/docs/api/java/util/Comparato... Since it seems like you're talking about visual activity now instead of visual clarity, I agree that Java will be more "hard to read" under your definition. But aside from the two lines for the class declaration & method declaration and the other two for the ending brackets, there really isn't much bloat. All that you have to implement for a simple numerical sort is some logic if a > b return 1 else if a == b return 0 else return -1. |
|