Results 1 to 2 of 2
  1. #1
    rajinder5 is offline Member
    Join Date
    Oct 2010
    Posts
    17
    Rep Power
    0

    Default java collection api

    hi!
    java collections interfaces such as "list" are ordered. what does the the word "ordered" (with respect to retrieving elements) here means???
    thanks...

  2. #2
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,365
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by rajinder5 View Post
    hi!
    java collections interfaces such as "list" are ordered. what does the the word "ordered" (with respect to retrieving elements) here means???
    thanks...
    The elements are ordered in the way you insert them in an ordered collection; as a counter example a HashSet or an OrderedSet isn't ordered that way; the first one orders the elements it sees fit and the second one (despite its name it doesn't order the elements in the same order as you inserted them) orders the elements according to their 'natural' order, whatever that is; e.g. Strings are stored in lexicographical order.

    kind regards,

    Jos

Similar Threads

  1. java collection arraylist in jdk 1.4
    By jagdish_ in forum Advanced Java
    Replies: 1
    Last Post: 06-12-2010, 02:19 PM
  2. Java Collection class & methods
    By box2box in forum New To Java
    Replies: 2
    Last Post: 05-26-2010, 01:51 AM
  3. know the class coming under the collection api in java
    By javastuden in forum New To Java
    Replies: 1
    Last Post: 11-24-2009, 07:10 AM
  4. Collection - java
    By Moonlightkid in forum Advanced Java
    Replies: 3
    Last Post: 09-02-2008, 05:04 AM
  5. Java Collection Framework (Sets)
    By Java Tutorial in forum Java Tutorial
    Replies: 0
    Last Post: 12-07-2007, 07:50 PM

Posting Permissions

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