There's a question in the S&B
test exam where ArrayList object (referenced as List) is sorted using a Collections.sort method and printed.
The sort method is invoked with a List object, not a List of Integer's or
String's, but a plain old List of Object's. I thought that Object didn't implement Comparable interface and therefore the code above wouldn't compile, or at least throw an exception during the 'sorting'. But no, it compiles, runs and produces output [5, 17, 42, 812].
I guess my question is, how is it possible?
Thanks in advance
[ January 11, 2007: Message edited by: Kay Osade ]