Collections in Java
HashMap: -------- hashCode() method is used to get the hash code of the object. In HashMap, hashCode() is used to calculate the bucket. Bucket - used to store nodes. 2 or more nodes can have same bucket. Those nodes are linked via linked list. index of bucket = hashCode(key) & (n-1) n=size of bucket array HashMap hm = new HashMap(); hm.put("a",1); First, hashCode of key 'a' is calculated and then the index of bucket array. Second, the details of element is stored as a linked list. { int hash = 115 Key key = {"saurabh"} Integer value = 30 Node next = null } Third, in case of same index the new element is saved as an linked list with address saved on next variable of first element. Collection: ---------- 1. Iterable Interface: Root interface of all collection class. it contains only one abstract method i.e., Iterator<T> iterator() 2. Collection Interface : implemented by all class in collection framework. Declares the method that ev...