27 February 2009 - java_dev (original) (raw)

10:40 pm - siliconstitches - Java Beginner My first experience with java is to create a class that deals with coding a sorting class that will sort any object you give it without declaring it as an object within the "test" file. For the most part I'm just having issues getting it to work "with every comparable object". I know that every class is a subclass of Object so I assumed that by extending Object (which seems useless now that I think about it), it should be able to take any class and be able to sort it however, was not the case.Another minor issue I was confused about was that if you create a global class to sort, shouldn't the compareTo be able to work only on the item you pass through it? By which you would not have to create a compareTo method within "global sort"?**( Code below for reference.Collapse )**Thanks for the advice in advance.