All languages

Java

You're viewing a free preview. Sign in free to read every script.

Why this exists Almost everything in a Java program lives in a List, a Set or a Map. Choosing the right one, and knowing a few idioms (counting with merge, grouping with computeIfAbsent), removes a great deal of loop…

Java Basics: Collections and Generics

Lists, sets and maps and when to use each, counting and grouping with merge and computeIfAbsent, sorting with Comparator, immutable collections, safe removal while iterating, Optional, and writing a generic method.

Sign in free to read this script, along with the rest of the library.

Sign in free