-
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.
-
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) )
-
Re: Sorting a list
Kindly format the code in your post. it's really annoying to read when unformatted.
-
Re: Sorting a list
Thanks for your response. Its worked.