Alex Rivera | Logout

Java Equivalent to Python Dictionaries

Asked 2009-10-08T21:44:34.347
124

I am a long time user of Python and really like the way that the dictionaries are used. They are very intuitive and easy to use. Is there a good Java equivalent to python's dictionaries? I have heard of people using hashmaps and hashtables. Could someone explain the similarities and differences of using hashtables and hashmaps versus python's dictionaries?

Edit
Report

1 Answer

5

As far as I'm aware (I don't actually use java) dictionaries are just another name for a hashmap/hashtable.

Grabbing code from http://www.fluffycat.com/Java/HashMaps/ it seems they are used in a very similar manner, with a bit of extra java boiler-plate.

answered 2009-10-08T21:46:16.993

Your Answer