Why I can't pass the test?
package zh.codegym.task.task08.task0802;
/*
包含 10 个对的 HashMap
*/
import java.util.*;
public class Solution {
public static void main(String[] args) throws Exception {
//在此编写你的代码
HashMap<String, String> map = new HashMap<String, String>();
map.put("西瓜", "瓜");
map.put("香蕉", "水果");
map.put("樱桃", "水果");
map.put("梨", "水果");
map.put("哈密瓜", " 瓜");
map.put("黑莓", "水果");
map.put("人参", "根");
map.put("鸢尾花", "花");
map.put("土豆", "块茎");
Iterator<Map.Entry<String, String>> it = map.entrySet().iterator();
while(it.hasNext()){
Map.Entry<String, String> entry = it.next();
System.out.println(entry.getKey()+" - "+entry.getValue());
}
}
}