Results 1 to 4 of 4

Thread: Sorting a list

  1. #1
    sivasiv is offline Member
    Join Date
    Jan 2012
    Posts
    2
    Rep Power
    0

    Default 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.

  2. #2
    doWhile is offline Moderator
    Join Date
    Jul 2010
    Location
    California
    Posts
    1,641
    Rep Power
    7

    Default 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) )

  3. #3
    clydedoris is offline Member
    Join Date
    Feb 2010
    Posts
    80
    Rep Power
    0

    Default 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?]

  4. #4
    sivasiv is offline Member
    Join Date
    Jan 2012
    Posts
    2
    Rep Power
    0

Similar Threads

  1. List of Lists sorting
    By Nerijus in forum New To Java
    Replies: 8
    Last Post: 05-14-2011, 06:26 PM
  2. Array List Sorting
    By makpandian in forum New To Java
    Replies: 5
    Last Post: 11-14-2010, 03:33 AM
  3. Need help with sorting a linked list
    By SteroidalPsycho in forum New To Java
    Replies: 0
    Last Post: 05-04-2010, 02:15 AM
  4. list sorting problem.
    By bit_bit in forum Advanced Java
    Replies: 2
    Last Post: 02-26-2010, 05:17 AM
  5. List Sorting method.
    By bit_bit in forum New To Java
    Replies: 1
    Last Post: 02-24-2010, 12:44 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •