Reputation: 86135
coming from .Net world, just want to know what is the corresponding collection to .Net Dictionary
Upvotes: 3
Views: 4330
Reputation: 16190
You clould use java.util.Properties which extends Hashtable
and uses String
as key and value type.
Upvotes: 0
Reputation: 8586
Probably:
Map<String, String> map
If you want ordered keys:
map = new TreeMap<String, String>();
If you want O(1) ops instead of O(lg n):
map = new HashMap<String, String>();
Upvotes: 7
Reputation: 86774
Interface Map<String,String>
, implementation classes HashMap<String,String>
or TreeMap<String,String>
Upvotes: 2