Answer Posted / guest
Java Collection Framework - Map Interface
The Map interface is not an extension of Collection
interface. Instead the interface starts of it?s own
interface hierarchy, for maintaining key-value associations.
The interface describes a mapping from keys to values,
without duplicate keys, by defination.
The Map interface follows.
public interface Map<K,V> {
// Basic operations
V put(K key, V value);
V get(Object key);
V remove(Object key);
boolean containsKey(Object key);
boolean containsValue(Object value);
int size();
boolean isEmpty();
// Bulk operations
void putAll(Map<? extends K, ? extends V> m);
void clear();
// Collection Views
public Set<K> keySet();
public Collection<V> values();
public Set<Map.Entry<K,V>> entrySet();
// Interface for entrySet elements
public interface Entry {
K getKey();
V getValue();
V setValue(V value);
}
}
| Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
What is an iterator java?
What is overriding in java?
5 Coding best practices you learned in java?
Do I need java for windows 10?
What is the program development process?
What is the primary benefit of encapsulation?
Explain constructors and types of constructors in java.
What is the use of StringTokenizer class?
What is the default value of float and double datatype in java?
Explain about assignment statement?
What is java and their uses?
What is object class in java?
How do you define a singleton class?
Can we write class inside a class in java?
What is the meaning of flag day?