File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes collections framework.. Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Professional Certification » Programmer Certification (SCJP/OCPJP)
Reply Bookmark "collections framework.." Watch "collections framework.." New topic
Author

collections framework..

Baskaran Subramani
Ranch Hand

Joined: Jul 30, 2000
Posts: 38
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..
Ada Wang
Greenhorn

Joined: Aug 28, 2000
Posts: 23
when you look up Java API documentation, you will notice the following classes are existed:
Treemap
HashSet
ArrayList
Vector
There is no Arraymap class.
Paul A
Ranch Hand

Joined: Aug 25, 2000
Posts: 44
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!


<A HREF="http://pages.about.com/jqplus" TARGET=_blank rel="nofollow">http://pages.about.com/jqplus</A> <BR>Get Certified, Guaranteed!
Baskaran Subramani
Ranch Hand

Joined: Jul 30, 2000
Posts: 38
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.
 
IntelliJ Java IDE
 
subject: collections framework..
 
Threads others viewed
Collections
Help Change Class Please
Serialization of a Collection
which is cheaper
what's the difference between hashtable and hashMap
developer file tools