Map

Map is not a part of collection


to add the elements use put(object,object);

to get the Key use getKey();


Inside the Map interface, Entry interface will be present,

Interface Map {

    Interface Entry {

                }

}

 

In LinkedHashMap Order of insertion is preserved whereas in HashMap Order of insertion is not preserved. LinkedHashMap is a Child of HashMap. 

If it is a HashMap, JVM internally calls equals(obj) to identify whether keys are duplicated are not. 

    



Garbage collector won't clean the null objects because HashMap will always dominate the garbage collector.

Garbage collector will clean the objects if it is present in WeakHashMap. So gc collector dominates over weak hashmap.













Comments

Popular posts from this blog

Advantages and Disadvantages of Monolithic Architecture

Monolithic Architecture

Eclipse debugging