This discussion is archived
4 Replies Latest reply: Jan 4, 2013 5:53 AM by 806469 RSS

problem to Collections.sort() in jdk1.7.0_06 & jdk1.7.0_09

vijay4javatech Newbie
Currently Being Moderated
Hello friends,
I just migrated to latest jdk. Before now, I was using jdk1.6.0_04 and now switched to jdk1.7.0_09.
Here I'm facing a problem with Collections.sort(). I have implemented my comparator and accordingly trying to sort my object list. My object list is not getting sorted with latest jdk.
Some of you may know this thing, can you help me in the regard.
some part of code is as shown below

java.util.Collections.sort(list, mycom);

class MyComplinkid extends SortDtls implements Comparator{
     public int compare(Object a ,Object b){
          sortdtsale t1 = (sortdtsale) a;
          sortdtsale t2 = (sortdtsale) b;
          double aint,bint;
          aint = t1.LinkID;
          bint = t2.LinkID;
          return (aint < bint ?1:0);
     }
}

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points