HashMap example

public class HashMapDemo {

	public static void main(String[] args) {
		Map punkerMap = new HashMap();
		punkerMap.put("Johnny Rotten", new Double(58584.34));
		punkerMap.put("Sid Vicious", new Double(2332.45));
		punkerMap.put("Joe Strummer", new Double(1000.34));
		punkerMap.put("Mick Jones", new Double(345345.34));
		Set punkerSet = punkerMap.entrySet();
		Iterator i = punkerSet.iterator();
		while (i.hasNext()) {
			Map.Entry me = (Map.Entry) i.next();
			System.out.println(me.getKey() + ":" + me.getValue());
		/*Sell more records and deposit money into the once bitter and disenfranchised
		youth's bank accounts*/
		double balance = ((Double) punkerMap.get("Joe Strummer")).doubleValue();
		punkerMap.put("Joe Strummer", new Double(balance + 14567.23));
			"Joe Strummer's new balance is now:" + punkerMap.get("Joe Strummer"));

refference : i don’t know, but thank you very much.


About WK

Kajook is a Senior Software Engineer. Job is Design & Develop in Java EE environment on Glassfish. I'm Interested in Agile software development ,iOS and Android.
This entry was posted in knowledge and tagged , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s