现在我有了一本这样的字典
Dictionary dict = new Hashtable();
dict.put("shipno", item.getShipNumber());
dict.put("addr", item.getFinalAddr());
dict.put("receiver", item.getReceiverName());
dict.put("phone", item.getReceiverPhone());
我要将这个字典作为参数传递给 funcion Test(),我应该在 '()' 中放入什么
public static int Test(Dictionary)
这是正确的吗?谢谢!
最佳答案
在您的代码中,您必须调用此方法:
Dictionary dict = new Hashtable();
dict.put("shipno", item.getShipNumber());
// CAll THIS METHOD
Test(dict);
在你的方法中你可以获得这些数据:
// YOUR METHOD, where "dict" is passed argument/parameter
public static int Test(Dictionary dict) {
}
关于JAVA字典作为参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55099291/