Hi,

I am trying to understand exercise 5.2 of the Java Collections. I don't 
understand the MyComparators class.

  public static Comparator stringComparator() {

        // I have never seen a class that begins with a return statement, 
Are we returning a Comparator object with all its variables?
        return new Comparator() {
   
         //The compare method never gets called in the Main class, where it 
is being called. Am I overlooking something? not sure why this method is 
needed.
            public int compare(Object o1, Object o2) {


Thanks all

-- 
You received this message because you are subscribed to the Google Groups 
"JPassion.com: Java Programming" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
Visit this group at http://groups.google.com/group/jpassion_java.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to