我正在学习如何利用哈希姆普,
我的测试项目正在发挥作用,但需要消除一些警告,
public static void main() {
Map <String, String>mMap = new HashMap<String, String>(); //crea nuevo HashMap
mMap.put("llave 1", "la llave uno"); //le mete cosas al hashMap
mMap.put("llave 2", "la llave dos");
mMap.put("llave 3", "la llave tres");
mMap.put("llave 4", "la llave cuatro");
Iterator iter = mMap.entrySet().iterator();
while (iter.hasNext()) {
Map.Entry menEntry = (Map.Entry) iter.next();
Log.d("msg", "key:"+menEntry.getKey() +" value:"+menEntry.getValue());
} } }
页: 1
Iterator iter = mMap.entrySet().iterator();
i 收到警告:,本行
上的多标记> Iterator <E>, what is, the made?, Error?, what to place?
并发出同样的警告:
Map.Entry menEntry = (Map.Entry) iter.next();
感谢很多!