4 Replies Latest reply: Sep 11, 2007 3:39 PM by 796440 RSS

    Collections.sort() Numbers Is Broken

    807605
      Hey, I am trying too sort an arraylist with numbers in it. I wanted to use the collections sort to do this but it only looks at the first number for some reason. I want it to look at the whole number and sort it accuratly

      Collections.sort(arr);

      ex: if numbers are 1,21,2,15,3

      it prints

      1
      15
      2
      21
      3

      when it should print

      1
      2
      3
      15
      21

      Whats up? thanks.

      Message was edited by:
      Sucka8