Summary
This chapter introduced you to the Java collections framework and its three main interfaces: List
, Set
, and Map
. Each of the interfaces was discussed and its methods were demonstrated with one of the implementing classes. The generics were explained and demonstrated as well. The equals()
and hashCode()
methods have to be implemented in order for an object to be capable of being handled by Java collections correctly.
The Collections
and CollectionUtils
utility classes have many useful methods for collection handling and were presented in examples, along with the Arrays
, ArrayUtils
, Objects
, and ObjectUtils
classes.
The class methods of the java.time
package allow time/date values to be managed and were demonstrated in specific practical code snippets.
You can now use all the main data structures we talked about in this chapter in your programs.
In the next chapter, we will overview JCL and some external libraries, including those that support testing. Specifically...