Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Lists allow duplicate items, while Sets allow only one instance.</p> <p>I'll use a Map whenever I'll need to perform a lookup.</p> <p>For the specific implementations, there are order-preserving variations of Maps and Sets but largely it comes down to speed. I'll tend to use ArrayList for reasonably small Lists and HashSet for reasonably small sets, but there are many implementations (including any that you write yourself). HashMap is pretty common for Maps. Anything more than 'reasonably small' and you have to start worrying about memory so that'll be way more specific algorithmically.</p> <p><a href="http://www.roseindia.net/javatutorials/linkedlistvsarraylist.shtml" rel="nofollow noreferrer">This page</a> has <strong>lots</strong> of animated images along with sample code testing LinkedList vs. ArrayList if you're interested in hard numbers.</p> <p><strong>EDIT:</strong> I hope the following links demonstrate how these things are really just items in a toolbox, you just have to think about what your needs are: See Commons-Collections versions of <a href="http://commons.apache.org/collections/api-release/org/apache/commons/collections/map/package-summary.html" rel="nofollow noreferrer">Map</a>, <a href="http://commons.apache.org/collections/api-release/org/apache/commons/collections/list/package-summary.html" rel="nofollow noreferrer">List</a> and <a href="http://commons.apache.org/collections/api-release/org/apache/commons/collections/set/package-summary.html" rel="nofollow noreferrer">Set</a>.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload