Java: The Collections Framework
Both C++ and Java have libraries that let us implement common data structures. In Java, we use the collections framework which provide various types of containers for storing and manipulating collections of objects or data. These containers are known as collections.
- C++ has STL
- Java has Collections classes
Java has the collections classes:
We can use the java util package and to import whole package:
import java.util.*;
For high-level applications it is relatively rare to build your own linked list, hash table, binary search tree, etc. Instead these are already implemented for us through these classes!
By using the collections provided by the framework, developers can focus on solving business problems rather than worrying about the low-level details of collection implementation.
Nevertheless the occasion does arise to construct your own class or to modify the class, so it is important to know how the lower-level algorithms work.