I have a generic class which will be Long, Float, Integer and String types. In the cases of Number (Long, Float and Integer), I want to compare two of them to see which one is bigger or smaller. Is it possible?
I have a generic class which will be Long , Float , Integer and
Share
Its possible with a moderately complex Comparator implementation and liberal use of the ‘instanceof’ keyword.
http://download.oracle.com/javase/6/docs/api/java/util/Comparator.html