【发布时间】:2025-12-06 16:40:01
【问题描述】:
我有调用在 JAVA Ecllips 开普勒中创建的 SOAP 服务的 C#.Net 代码。从 Web 服务公开的 API(函数)应将 C#.NET 代码中的数据作为参数。我需要发送到 API 的数据是 c#.NET 中的字典字典,如下所示:
Dictionary<string, Dictionary<string, string>> LinksCollection = null;
如何在 Java 中实现这种结构?
我搜索和尝试的内容:
1]以下是在java中实现字典的方法:
1]HashMap
eg:Map<String, String> map = new HashMap<String, String>();
2]LinkedHashMap
3]Hashtable
eg: Dictionary d = new Hashtable();
Is it the right way to implement as follows ?
Declaring Dictionary:
Map<String, String> mapA = new HashMap<String, String>();
Declaring Dictionary of Dictionary:
Map<String, mapA> map = new HashMap<String, mapA>();
【问题讨论】:
-
Map<String, Map<String, String>> map = new HashMap<>()会是一个更好的起点
标签: java dictionary