2) How do you add key-value pairs to HashMap?->using add() or addAll() method
3) How do you add given key-value pair to HashMap if and only if it is not present in the HashMap?
4) How do you retrieve a value associated with a given key from the HashMap?
5) How do you check whether a particular key/value exist in a HashMap?
6) How do you find out the number of key-value mappings present in a HashMap?
7) How do you remove all key-value pairs from a HashMap? OR How do you clear the HashMap for reuse?
8) How do you retrieve all keys present in a HashMap?
9) How do you retrieve all the values present in a HashMap?
10) How do you retrieve all key-value pairs present in a HashMap?
11) How do you remove a key-value pair from the HashMap?
12) How do you remove a key-value pair from a HashMap if and only if the specified key is currently mapped to given value?
13) How do you replace a value associated with a given key in the HashMap?
14) How do you replace a value associated with the given key if and only if it is currently mapped to given value?
15) How do you get synchronized HashMap in java?
No comments:
Post a Comment