如何在获取“无法解决放置符号”错误时向Hashmap添加键和值(How to add keys and values to a Hashmap while getting 'cannot resolve put symbol' error)
我正在使用Android Studio 1.4.1,我刚刚创建了一个Hashmap,并且正在关注如何填充和操作它的教程(在java上)。 但是我得到一个'无法解决符号放置'错误,而“put”命令为红色。 我添加的图像显示了自动完成快照,虽然导入了java.util.HashMap,但自动完成中没有“put”命令。 可用命令也以红色显示。 我尝试使用它们而不是“put”命令。 我一直有这种类型的问题。 有人可以帮忙吗? 先谢谢你...
import java.util.HashMap; HashMap<String, String> pozisyon = new HashMap<String, String>(); pozisyon.put("SKale", "a8");
I am working with Android Studio 1.4.1 and I had just created a Hashmap and was following a tutorial (on java) on how to populate and manipulate it. However I get a 'cannot resolve symbol put' error and the "put" command is in red. The image I added shows the auto complete snapshot and although java.util.HashMap is imported there is no "put" command that is available in autocomplete. The available commands also are showing in red. I tried to use them instead of the "put" command. I keep having this type of problem all along. Can anyone help? Thank you in advance...
import java.util.HashMap; HashMap<String, String> pozisyon = new HashMap<String, String>(); pozisyon.put("SKale", "a8");
原文:https://stackoverflow.com/questions/34158839