• Post Reply Bookmark Topic Watch Topic
  • New Topic

Sorting  RSS feed

 
praneeth ram
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • 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 .
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is your order to sort?
 
Harsha Gedala
Ranch Hand
Posts: 41
Eclipse IDE Java Oracle
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!