What is Map interface?

Answers were Sorted based on User's Feedback



What is Map interface?..

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

What is Map interface?..

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

What is Map interface?..

Answer / sushila

map is not a collection type but it is part of collection API

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More Core Java Interview Questions

How HashMap implemented in java? how it internally works when values are added or searched from hashMap?What is the difference betweenthe implementation of hashmap and Linked Hashmap?

3 Answers   IBM,


What is r * in math?

0 Answers  


Can java hashmap have duplicate keys?

0 Answers  


what us Dyna action form?

4 Answers   Aithent Technologies,


When is finally block not called?

0 Answers  






What is the difference between path and classpath variables?

0 Answers  


What are Encapsulation, Polymorphism and Inheritance?

5 Answers  


Is there is any error if you have multiple main methods in the same class?

10 Answers   Infosys, Wipro,


Can subclass overriding method declare an exception if parent class method doesn't throw an exception?

0 Answers  


What is complexity and its types?

0 Answers  


What is a java object and java application?

0 Answers  


class A { private int i; } class B extends A { private int i; } if I create an object of B class what will be the memory of that object.

2 Answers   Yamaha,


Categories