HashMap Flashcards
1
Q
- What are the classes we have in map interface?
- What will happen if i give same key , value pair again in hashmap?
3.What will happen if i give same key , different value pair again in hashmap? - Does HashMap follows insertion Order ?
- If i insert Key value with New key and same value what will happen?
- To get the records we can use key value ?
A
- HashMap, LinkedHashMap,
Legacy Class: HashTable, properties
Map - SortedMap, TreeMap, Navigable Map - It won’t change anything, it remains unchanged.
- it will change the value
- No , there is no insertion order for HAshMap.
- It will add a new record key map in the heap memory
- Yes key should be used bcoz value can have duplicate so
hm.get(10);