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

why did you choose your career in IT?

1 Answers   LIC,


What are inner classes or non static nested classes in java?

0 Answers  


What is function and method in java?

0 Answers  


What is skeleton and stub?

0 Answers  


Can a top level class be private or protected?

0 Answers  






Why object class is super class for every class in java?

0 Answers  


Can an interface extands a class?

5 Answers  


Explain notifyall() method of object class ?

0 Answers  


How do you add an element to an arraylist in java?

0 Answers  


Explain heap sort?

0 Answers   Flextronics,


Why should we create an object? what is a need of it? Apart from access members of a class i want what is a need of object what does it contain?? In normal class to access any member of thaht class we create object where as for static class we access its members using class name. what is a difference between them... thanks in advance.

1 Answers  


How many types of variables are there?

0 Answers  


Categories