Java collections
Collections are interfaces and classes that help us store more than one object. We have already seen arrays that can do that, and also ArrayList
in the previous chapters, but we did not discuss in detail what other possibilities there are in the JDK. Here, we will go into more detail, but leave the streams and the functional methods for later chapters, and we will also refrain to go into details that is rather the task of a reference book.
Using implementation of the collection classes and interfaces reduces the programming effort. First of all, you do not need to program something that is already there. Secondly, these classes are highly optimized, both in implementation and in their features. They have very well designed API as well as the code is fast and uses small memory footprint. Sorry to say that their code was written long time ago and many times it is not a good style, hard to read, and understand.
When you use a collection from the JDK, it is more likely that you...