如何将 null 值传递到 HashMap?
下面的代码段使用填充的选项:
HashMap<String, String> options = new HashMap<String, String>();
options.put("name", "value");
Person person = sample.searchPerson(options);
System.out.println(Person.getResult().get(o).get(Id));
那么问题就是要在选项和方法中输入什么才能传递一个空值?
我尝试了以下代码,但没有成功:
options.put(null, null);
Person person = sample.searchPerson(null);
options.put(" ", " ");
Person person = sample.searchPerson(null);
options.put("name", " ");
Person person = sample.searchPerson(null);
options.put();
Person person = sample.searchPerson();