Browse DevX
Sign up for e-mail newsletters from DevX

Tip of the Day
Language: Java
Expertise: Intermediate
Jul 14, 1999



Building the Right Environment to Support AI, Machine Learning and Deep Learning

Understand the Main Interfaces of the Collections API

JDK 1.2 includes a new library of data structures called Collections. The Collections API contains object collection data structures. The Collection interface is the root interface for all the Collection classes. It basically represents a group of object called "elements." If you want to store a collection of unique elements and do not care about the order in which they are stored, use a Set. To store a collection of unique ordered elements, use a SortedSet. To store a collection of ordered elements, (not necessarily unique), use a List. To store an unordered collection of elements that are retrievable by key, use a Map. Finally, to store an ordered collection of elements that are retrievable by key, use SortedMap. The following data structures of JDK 1.1 have been replaced in JDK 1.2: Vector is replaced with List, and Hashtable is replaced with Map.
Ajit Sagar
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date