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 java util?
What is canonical name in java?
What are the 6 boolean operators?
What is the purpose of the wait(), notify(), and notifyall() methods in java programming?
What is the symbol for line break?
Is static a keyword in java?
How list contains works in java?
Why super is first line in java?
Does treeset allow null in java?
What is multiple inheritance? Is it supported by java?
What is the difference between member variables initialization and assignment in a constructor?
Difference between arraylist and hashset in java?
What is difference between static variable and global variable?
explain copyonwritearraylist and when do we use copyonwritearraylist?
What is token in java?