Using Stream APIs and Collections

By definition, an object-oriented application is one that creates and uses objects, and most useful applications create and manage groups of objects. In fact, maintaining a group, or collection, of objects is done so often that Java’s core library has always included classes designed specifically for that purpose.

To understand why collection classes are so important, let’s briefly examine the alternative and what limitations existed. Before object-oriented programming became popular, procedural languages typically used arrays to maintain groups of related values. Arrays are, of course, supported by ...

Get Pro Java 8 Programming, Third Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.