Different ways of iterating on a HashMap in JavaTech by Sunny Srinidhi - August 7, 2020August 7, 20200 In this post, we will learn how to iterate over the keys in a HashMap in five different ways, including a couple of Streams APIs.
HashMap implementation in JavaTech by Sunny Srinidhi - January 3, 2020January 3, 20203 More in The Data Structures series. In our data structure series, we have already looked at a couple of ways in which we can implement a stack, and also Single Linked Lists (SLL) and Double Linked Lists (DLL). In this post, we'll see how we can implement our own HashMap and see a couple of examples of how we can use that HashMap. Let's get started. The HashMap Before we can start with the implementation of the HashMap, we need to understand how the stuff actually works. This is a combination of an array and a LinkedList. So it's a bit interesting. When we add an item to a HashMap, we provide a key and a value. The key will be used as a