开发者

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

开发者 https://www.devze.com 2023-02-02 22:26 出处:网络
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

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

精彩评论

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