Search:

Type: Posts; User: helloworld922

Search: Search took 0.09 seconds.

  1. Replies
    12
    Views
    10,884

    Re: Collection.sort problem

    You can't simply add a new item and assume it will be put in sorted order into your arraylist. There are two options:

    1. Re-sort your arraylist.
    2. Manually look for where the book needs to be...
  2. Replies
    12
    Views
    10,884

    Re: Collection.sort problem

    Don't create your own collection class, there's already one which exists.

    Simply create your list of comparable objects and pass them to your algorithm.

    Here's a simple example:

    // Book...
Results 1 to 2 of 2