开发者

Is there a Java equivalent of KeyValuePair<T, T> (i.e. a single hashmap 'cell') type?

I used to find these very useful in .NET and I'm unsure of any equivalen开发者_Python百科t.


There's Map.Entry<K, V>, which represents map entries. I'm not a C# programmer, but this seems like the most similar thing to what you want.


Not sure if this is what you're looking for but there's a singleton hashmap:

Map<K, V> map = Collections.singletonMap(key, value);

Maybe you can describe what you would like to do with it?

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜