Arrays Strings ========================================================== Collection Framework (ArrayList, HashSet, HashMap) ArrayList: ========== its a growable array (dynamic array) insertion order duplicates are allowed Hetrogenious objects are allowed we have an add method to add an element to Arraylist how to get size of ArrayList .size() method ========================================================= public class Sample { public static void main(String[] args) throws NumberFormatException, IOException { ArrayList obj=new ArrayList(); obj.add(123); obj.add("Sunil"); obj.add(89.77); obj.add(1000); System.out.println(obj); } } ============================================================== HashSet ============= it doesnt support duplicate elements insertion order not preserved it uses hashing technique to get elements HashSet internally HashMap it supports hetrogenious elements HashSet hs=new HashSet<>() hs.add(10) ===================================================================== HashSet hs=new HashSet<>(); hs.add(10); hs.add(10); hs.add(20); hs.add(30); hs.add(30); hs.add(40); hs.add(null); System.out.println(hs.size()); System.out.println(hs); =================================================================== HashMap: ======== we can store records in form of key and value null also allowed as key duplicate keys are not allowed loadfactor = oldsize+3/2*oldsize ======================================= put() -----> to insert a record get() -----> to get the value of particular key containsKey() ----> to check wheather given key is there or not size() --------> Number of records ================================ package basic; import java.io.IOException; import java.util.HashMap; //Prime number public class Sample { public static void main(String[] args) throws NumberFormatException, IOException { HashMap hm=new HashMap<>(); hm.put(11,"Sunil"); hm.put(12, "Vishal"); hm.put(13,"Abhidutta" ); hm.put(14, "Nethu"); hm.put(14, "Kiran"); hm.put(null, "Null value"); hm.put(null, "Null value 300"); System.out.println(hm); System.out.println(hm.get(12)); System.out.println(hm.get(13)); System.out.println(hm.containsKey(10)); System.out.println(hm.size()); } } ======================================================================