Java: The Collections Framework

Nathan Chiche
NewTechTips
Published in
1 min readDec 20, 2022
Photo by Shahadat Rahman on Unsplash

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.

--

--

Nathan Chiche
NewTechTips

Huge passion for software development, Data Analytics, Information Technology, and more.