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 the purpose of void class?
What is the difference between yield() and sleep()?
how to deploy tomcatserver to weblogic server? write d following steps?
What is the size of arraylist in java?
Explain static nested classes ?
How to create a fecelet view?
Which package has light weight components in java programming?
How do you reverse a word in java?
What are green threads in java?
Can we declare main () method as non static?
What is boolean in java?
Can we overload the constructors?
What is re-factoring in software?
What are the advantages of user defined functions?
Explain Basics of OOP Language in java