Evil Java Man
At some point I became one of those crazed java programmers. The sort that uses recursive type signatures. The guy that uses Interfaces with glee, just to get some real polymorphism in the language. Inner classes, anonymous classes, generic classes, enumerated classes, abstract classes. Then again, this is probably connected to the fact that you have to write classes to get anything done in java. This some code I wrote today for a class project:
public enum SortOrder {
ASCENDING {
<T extends Comparable<T>> boolean compare(T x, T y) {
return x.compareTo(y) < 0;
}
},
DESCENDING {
<T extends Comparable<T>> boolean compare(T x, T y) {
return y.compareTo(x) < 0;
}
};
abstract <T extends Comparable<T>> boolean compare(T x, T y);
}
I should not be as amused by that as I am.