The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
November 2001

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

I soved!!

Posted by Eduardo on November 07, 2001 at 12:58 PM

Here is the proper implementation:


public class LongComparator implements Comparator{
public int compare(Object o1, Object o2) {
Long ss1 = new Long(Long.parseLong(o1.toString().trim()));
Long ss2 = new Long(Long.parseLong(o2.toString().trim()));
return ss1.compareTo(ss2);
}
}

Thank you for your help!



Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us