• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

collections framework..

 
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I found this in one of the mock exams. Could anyone clarify this?
Which of these implementations for collections framework interfaces are provided in the standard JDK? (first of all I am not comfortable/clear with this question..!! )
Treemap
ArrayMap
HashSet
ArrayList
Vector
the answer given is Treemap,ArrayList and Vector..
 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
when you look up Java API documentation, you will notice the following classes are existed:
Treemap
HashSet
ArrayList
Vector
There is no Arraymap class.
 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As you are aware, Collection interfaces are 'interfaces'. You need concrete implementations of these interfaces to use. Standard JDK also provides some classes that implement these interfaces. This is what the question is trying to ask.
Different implementations solve different purposes. For eg. HashMap and TreeMap both implement Map interface but their internal data structure is different which affects their performance in different cases. HashMap is faster to store and retireve but TreeMap is faster for ordering the elements.
It's a good idea, IMHO, to read the description of these classes.
-Paul.
------------------
http://pages.about.com/jqplus
Get Certified, Guaranteed!
 
Baskaran Subramani
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Paul and Wang. But If the question tries is to identify the classes in JDK that implements Collections interfaces, then
why Hashset(which implements Set) is not included in the answer list?(only Treemap, ArrayList and Vector are answers!!)
Thanks,
Baskaran.
reply
    Bookmark Topic Watch Topic
  • New Topic