• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic