Search:

Type: Posts; User: KevinWorkman

Search: Search took 0.11 seconds.

  1. Replies
    9
    Views
    10,671

    Re: Bubblesort of an ArrayList with objects

    The ArrayList doesn't implement Comparable. The Objects being stored in the ArrayList implement Comparable. If you don't want to do that, create a Comparator that does the same thing.

    For more...
  2. Replies
    9
    Views
    10,671

    Re: Bubblesort of an ArrayList with objects

    Huh? That's not at all how that method works. The sort() method is void, so it doesn't return anything. Did you read the API link I gave you?
  3. Replies
    9
    Views
    10,671

    Re: Bubblesort of an ArrayList with objects

    What are you confused about? You have an ArrayList of Customers, right? So make a Comparator for Customer (or make the implement Comparable) that sorts them in whatever fashion you want.
  4. Replies
    9
    Views
    10,671

    Re: Bubblesort of an ArrayList with objects

    Did you check out the API for Collections?

    Collections (Java Platform SE 6)
  5. Replies
    9
    Views
    10,671

    Re: Bubblesort of an ArrayList with objects

    Why don't you just use the Collections class and a Comparator?
Results 1 to 5 of 5