• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Sorting

 
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

List object contains the bellow information

Praneeth ABC 5 ID Operation
John DEF 6 DI OPeration
Jim XYZ 9 IDS Operation
Praneeth ABC 2 ID2 Operation
Praneeth DEF 3 ID Operation
Jim XYZ 9 IDS Operation
Jim XYZ 4 IDS Operation


now i want to retrive it in the bellow format (all the names should be in order)

Praneeth ABC 5 ID Operation
Praneeth ABC 2 ID2 Operation
Praneeth DEF 3 ID Operation
Jim XYZ 9 IDS Operation
Jim XYZ 9 IDS Operation
Jim XYZ 4 IDS Operation
John DEF 6 DI OPeration

Can anyone suggest the logic .
 
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
what is your order to sort?
 
Ranch Hand
Posts: 41
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The compareTo method of the Comparable interface. Implementing Comparable allows calling Collections.sort. It is always costly process in java to sort. It is usually much preferred to let the database perform the sort using the ORDER BY clause, rather than in code.
 
reply
    Bookmark Topic Watch Topic
  • New Topic