What is Map interface?
Answers were Sorted based on User's Feedback
Answer / ravikiran(aptech mumbai)
Map interface provides classes and interfaces to do
operations with objects saved as key value pairs
| Is This Answer Correct ? | 4 Yes | 0 No |
Answer / 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 |
Answer / sushila
map is not a collection type but it is part of collection API
| Is This Answer Correct ? | 1 Yes | 0 No |
how system.out.println() works?
Explain the importance of import keyword in java?
what is the difference between System.exit() and System.exit(1)?
1 Answers eClinical Solutions, eClinical Works, eClinicalWorks,
Is assembly language a low level language?
How to handle a web browser resize operation?
what do you understand by synchronization? : Java thread
What is the default access specifier for variables and methods of a class?
What is the difference between the font and fontmetrics classes in java programming?
What are meta-annotations?
write SQL command for table employee where print first name or last name start like "A" and who is working in domain(angular js,java,dotnet)
What is difference between an object and a class?
What are exception handling keywords in java?