3 ms·
Java has polymorphism, your type can implement (I think) comparator and that should be it. Of course, that doesn't work for int, float, etc because those types
by tomjen3 13y ago
Java has polymorphism, your type can implement (I think) comparator and that should be it.
Of course, that doesn't work for int, float, etc because those types aren't objects, but then you typically don't have an array of those.
- kyllo 13y agoHuh? You don't typically have an array of primitives? Says who? In Java, with the exception of String[], you would normally only use an array with primitives. If you're working with objects you would want to use a different data structure such as a linked list.