我使用的是當前細節格式爲HashMap的的Eclipse:詳細格式錯誤:<key>不能被解析爲一個變量
key + "-" + value
當我調試代碼..
import java.util.HashMap;
public class Test1
{
public static void main(String[] args)
{
HashMap<String, Integer> wordcount = new HashMap<String, Integer>();
wordcount.put("foo", 1);
wordcount.put("bar", 1);
System.out.println("test"); // set a breakpoint here
}
}
Eclipse在說變量標籤..
Detail formatter error:
key cannot be resolved to a variable
value cannot be resolved to a variable
其實我希望看到HashMap的值,當breakpoin t停在System.out.println
......不僅僅是wordcount HashMap<K,V> (id=16)
,而是它的內容。
郵更多的代碼。 – kosa 2012-08-02 15:32:02
看來你正在使用鍵和值作爲變量而沒有定義它們。 – SiB 2012-08-02 16:35:53
@BharatSinha,也許我使用了錯誤的方法,那麼當我想要在斷點處停下來的時候更好地查看hashmap的內容時,我應該怎麼做? – Howard 2012-08-03 06:51:09