Map and Types of Map - Collection Framework

Map and Types of Map - Collection Framework

Written by?- Prajval Bhale

mail: [email protected] | GitHub: github.com/prajvalbhale

(all content are available on my github Profile in PDF or Doc Format)

Key Takeaways:

>> Map Take's Care about Unique Identifier.

>> We can map Unique Key to specific Value.

>> Their is Key Value Pair in Map.

>> Followings are the types of HashMap:


No alt text provided for this image


A). HashMap:

  • this is unordered and unsorted.
  • we can use HashMap when we not care about Insertion order.
  • this allow one null key and multiple null Values.
  • Duplicates are not allow.
  • This set is not maintain any Insertion order and it is an unsorted.

B). HashTable:

  • this is Synchronised and Thread Safe
  • this not allow anything which is a Null.
  • Duplicate Keys are not allowed.

C).LinkedHash Map:

  • This maintain insertion order.
  • slower than HashMap
  • By using this I can expect fast Iteration.
  • Duplicate keys are not allowed.

D). TreeMap:

  • This is sorted in ascending order based on the key.
  • Duplicate keys are not allowed.

要查看或添加评论,请登录

Prajval Bhale的更多文章

社区洞察

其他会员也浏览了