The Artima Developer Community
Sponsored Link

Java Buzz Forum
10 Examples of HashMap in Java - Programming Tutorial

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Javin Paul

Posts: 1090
Nickname: javinpaul
Registered: Jan, 2012

Javin Paul is Java Programmer working on Finance domain.
10 Examples of HashMap in Java - Programming Tutorial Posted: Feb 25, 2013 8:40 AM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Javin Paul.
Original Post: 10 Examples of HashMap in Java - Programming Tutorial
Feed Title: Java67
Feed URL: http://www.java67.com/feeds/posts/default?alt=rss
Feed Description: Java and technology tutorials, tips, questions for all programmers.
Latest Java Buzz Posts
Latest Java Buzz Posts by Javin Paul
Latest Posts From Java67

Advertisement
HashMap in Java is one of the most popular Collection class among Java programmers. After by article How HashMap works in Java, which describes theory part of Java HashMap ,I thought to share, How to use HashMap in Java with fundamental HashMap examples, but couldn't do that and it was slipped. HashMap is a a data structure, based on hashing, which allows you to store object as key value pair, advantage of using HashMap is that, you can retrieve object on constant time i.e. O(1), if you know the key. HashMap implements Map interface and supports Generics from Java 1.5 release, which makes it type safe. There are couple of more Collections, which provides similar functionalities like HashMap, which can also be used to store key value pair. Hashtable is one of them, but Hashtable is synchronized and performs poor in single threaded environment. See Hashtable vs HashMap for complete differences between them. Another one, relatively new is ConcurrentHashMap, which provides better performance than Hashtable in concurrent environment and should be preferred. See difference between ConcurrentHashMap and HashMap for detail differences. In this Java tutorial, we will see different examples of  HashMap, like adding and removing entries, iterating over Java HashMap, checking size map, finding if a key or value exists on Map and various other examples, which we used frequently.
Read more »

Read: 10 Examples of HashMap in Java - Programming Tutorial

Topic: Testing Expected Exceptions with JUnit Rules Previous Topic   Next Topic Topic: Java 7: Fork/Join Framework Example

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use