Results 1 to 2 of 2
  1. #1
    briangriffin is offline Member
    Join Date
    Oct 2010
    Posts
    1
    Rep Power
    0

    Default sorting a set of data by 2 catagories?

    I have to write a program that sorts the data of employees in a company. I have to sort the data, first, by ethnicity. Second, sort the name alphabetically within the ethnicity. I have no problem to sort them separately, but i have absolutely no idea of how to sort the ethnicity then the name within the ethnicity. Could you guys give me some idea? THanks!

  2. #2
    eRaaaa is offline Senior Member
    Join Date
    Oct 2010
    Location
    Germany
    Posts
    787
    Rep Power
    6

    Default

    Quote Originally Posted by briangriffin View Post
    I have to write a program that sorts the data of employees in a company. I have to sort the data, first, by ethnicity. Second, sort the name alphabetically within the ethnicity. I have no problem to sort them separately, but i have absolutely no idea of how to sort the ethnicity then the name within the ethnicity. Could you guys give me some idea? THanks!
    When you sort the data by ethnicity, and the ethnicity between two compared objects are equal then you have to compare the names....

Similar Threads

  1. Sorting ArrayList by object data
    By drymsza1234 in forum New To Java
    Replies: 2
    Last Post: 04-15-2010, 01:22 AM
  2. Sorting data
    By yrollgayanth in forum Advanced Java
    Replies: 7
    Last Post: 12-30-2009, 06:16 PM
  3. Sorting data in a Vector
    By SBL in forum AWT / Swing
    Replies: 11
    Last Post: 11-27-2009, 03:20 AM
  4. sorting data in txt file
    By cassysumandak in forum New To Java
    Replies: 1
    Last Post: 04-12-2009, 03:02 AM
  5. Data Sorting in a .data file using java
    By stutiger99 in forum New To Java
    Replies: 2
    Last Post: 10-08-2008, 02:52 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •