Scenario based Hash /Map (Very Important) Flashcards
1
Q
- Entries are all objects it can be anything like 10.4F , or integer values , so at this Scenario what will you do ?
- Scenario : 1 in values we having 9:00 pm so we need all the travels name who is having 9:00 PM timing so what will you do ?
- What are all the methods you have Entry (Interface)
- What you will do to break the entries separately as key and value .
- Where and the value 10 is there i need that ? so what you will do ?
A
- We need to convert to objects. ,
2. - We have getKey, get value.
- To break separately into key ,value, we need to convert that into objects entries
Object o = i.next();
Map.Entry e = (Map.Entry) o;
by this after that we can use getkey() and getvalue().
5.
2
Q
1.What is Weakhashmap?
A
- Normally , if we set any key or value null after put and it used , hashmap won’t do nullify , so instead of using hashmap
we can use Weakhashmap.