LinkedHashMap overview

LinkedHashMap is based on HashTable and LinkedList implementation Main features of LinkedHashMap It also stores elements in the key-value pair like any other Map It maintains the Insertion order of elements It can have Null Key and Null Values Value can be retrieved by passing key If passed key is not exist in the Map […]

Share this article on

HashMap with Looping

We can iterate hashmap using enhanced for loop with keyset() method or by using enhanced for loop with EntrySet() method or by using iterator Case 1 : Enhanced for loop with keyset() Example import java.util.*; public class HashMapEnhancedForLoopExample { public static void main(String args[]) {   HashMap<Integer, String> hashMap = new HashMap<Integer, String>();     […]

Share this article on
< Previous Next >