Results 1 to 4 of 4
Thread: Sorting a list
- 01-06-2012, 12:28 AM #1
Member
- Join Date
- Jan 2012
- Posts
- 2
- Rep Power
- 0
Sorting a list
Hi All,
I am trying to sort my list and i am getting following error: cannot find method sort(java.util.List<InquiryCommDTO>)
I am pasting my code below please help me in how to sort my communicationList.
private List<InquiryCommDTO> communicationList = new ArrayList<InquiryCommDTO>();
communicationList = inquiryDTO.getCommunications();
Collections.sort(communicationList);// i am getting the above mentioned error on this line.
Thanks a lot in advance.
- 01-06-2012, 01:12 AM #2
Moderator
- Join Date
- Jul 2010
- Location
- California
- Posts
- 1,619
- Rep Power
- 5
Re: Sorting a list
Does InquiryCommDTO implements Comparable? If yes, please post an SSCCE that demonstrates the problem. If no, it must implement Comparable (see Comparable (Java Platform SE 6) )
- 01-06-2012, 05:20 AM #3
Member
- Join Date
- Feb 2010
- Posts
- 80
- Rep Power
- 0
Re: Sorting a list
Kindly format the code in your post. it's really annoying to read when unformatted.
[why are you annoyed with my sig?]
- 01-10-2012, 08:52 PM #4
Member
- Join Date
- Jan 2012
- Posts
- 2
- Rep Power
- 0
Similar Threads
-
List of Lists sorting
By Nerijus in forum New To JavaReplies: 8Last Post: 05-14-2011, 05:26 PM -
Array List Sorting
By makpandian in forum New To JavaReplies: 5Last Post: 11-14-2010, 02:33 AM -
Need help with sorting a linked list
By SteroidalPsycho in forum New To JavaReplies: 0Last Post: 05-04-2010, 01:15 AM -
list sorting problem.
By bit_bit in forum Advanced JavaReplies: 2Last Post: 02-26-2010, 04:17 AM -
List Sorting method.
By bit_bit in forum New To JavaReplies: 1Last Post: 02-24-2010, 11:44 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks