开发者

what is the java correponding collection to Dictionary<string, string>

coming from .Net world, just want to know what is the corresponding collection to .Net Dictio开发者_运维知识库nary


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>();


Interface Map<String,String>, implementation classes HashMap<String,String> or TreeMap<String,String>


You clould use java.util.Properties which extends Hashtable and uses String as key and value type.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜