Is there a way to compare two objects that are generic? I'm supposed to find the largest object in a linked list. My开发者_如何学编程 first guess was to use the Object's class compareTo method, but I couldn't get that to work. Thanks
I assume that the language is Java. (since you mentioned Object and compareTo)
I suggest you to have a have a look into Comparator and Comparable interfaces.
精彩评论