Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Sorting Array of Class

  1. #1
    Junior Member
    Join Date
    Nov 2012
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Sorting Array of Class

    Hi,
    I have one array of class and i want sorting array of class .
    How do i it?
    class test {
    double i;
    }
    test []myArray ;


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    SW Missouri
    Posts
    20,149
    Thanks
    48
    Thanked 2,158 Times in 2,131 Posts

    Default Re: Sorting Array of Class

    You could use the Arrays class's sort() method. You would need to provide a Comparator object.
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. help in sorting the array
    By alloka in forum What's Wrong With My Code?
    Replies: 5
    Last Post: October 15th, 2012, 01:54 PM
  2. Array sorting
    By renars in forum Java Theory & Questions
    Replies: 4
    Last Post: May 17th, 2011, 10:45 AM
  3. Sorting an array
    By thebestpearl in forum Collections and Generics
    Replies: 5
    Last Post: April 17th, 2011, 08:58 PM
  4. array sorting
    By herbisey in forum What's Wrong With My Code?
    Replies: 2
    Last Post: June 27th, 2010, 12:07 PM
  5. Sorting an Array
    By Prince_85 in forum Algorithms & Recursion
    Replies: 2
    Last Post: February 21st, 2010, 02:00 PM