How do I iterate a hash map in Java?
Learn to iterate HashMaps using forEach and Java 8’s new lambda syntax.
HashMaps are often considered preferable to other lookup structures due to their computational efficiency and should be a part of every Java developer’s repertoire. In this video, expert trainer Brian Gorman outlines the anatomy of a HashMap and then takes you through various methods for accessing key-value pairs from a HashMap. After watching this short tutorial, intermediate Java developers will be able to iterate HashMaps using forEach and Java 8’s new lambda syntax, while avoiding concurrent modification exceptions.
Grow your Java skills with our Mastering Java Learning Path in Safari
Brian L. Gorman is an experienced .NET developer, certified as an MCSD in C# .NET. Holding a Masters of Science in computer information systems, he has many years of experience instructing college-level SQL database, C#, VB.NET, Java, and Microsoft Office courses. Brian has also authored a number of full technical video courses on these subjects.