What is the Map interface

The Map interface replaces the JDK 1.1 Dictionary class and is used associate keys withvalues.

Showing Answers 1 - 1 of 1 Answers

Prabhas270

  • Jul 5th, 2008
 

Hi There,

 Map is one of the datastuctures provided by Sun.Map is an interface ,it is not extending from Collection interface as like List,Set,Queue does.

There are 4 Classes which are implemented the Map interface.


      HashMap
      HashTable
      LinkedHashMap
      TreeMap

And SortedMap is an interface extending from Map.Todo Sorting TreeMap implemented SortedMap Interface.

Coming to HashMap,We can store and maintain the data in the format of Key/Value  pairs .And HashMap allows null as key and value.But HashTable not allows.

As useval LinkedHashMap is to maintain te data in the format of insertion order.But it is little bit slow compare with HashMap.Iteration will be faster. 

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions