eclipse debug 技巧:[url]http://blog.csdn.net/niqinwen/article/details/8965340[/url]
eclipse调试java程序的九个技巧:[url]http://www.cnblogs.com/lingiu/p/3802391.html[/url]
新建调试类:
添加Wathch变量到Expression,添加表达式到display如下图:
[img]http://dl2.iteye.com/upload/attachment/0120/5300/360307db-b528-3a19-899e-4c721a55104c.png[/img]
选中某一行,右击,如下图:
[img]http://dl2.iteye.com/upload/attachment/0120/5307/c0967a93-1af9-3a20-a2e2-e88a27cd53d2.png[/img]
//inspect在本行上,显示表达式信息
//watch添加的expression窗口
//diplaly在display窗口显示
eclipse调试java程序的九个技巧:[url]http://www.cnblogs.com/lingiu/p/3802391.html[/url]
新建调试类:
package test;
import java.util.HashMap;
import java.util.Map;
public class testString {
@SuppressWarnings({ "unchecked", "rawtypes" })
public static void main(String[] args) {
/*String test = "this is test! " +
" ";
test.replaceAll("[\\t\\n\\r]", "").trim();
System.out.println("=========trim:"+test.trim());
System.out.println("=========repalce:"+test.replaceAll("[\\t\\n\\r\\s]", "").trim());*/
Map tMap = new HashMap<Object,String>();
tMap.put("1", "1");
tMap.put("2", "2");
tMap.put("3", "3");
for(Object oj : tMap.keySet()){
tMap.get(oj);
//选中则这一行,右键,inspect,watch,dispaly表达式tMap.get("2");
//inspect在本行上,显示表达式信息
//watch添加的expression窗口
//diplaly在display窗口显示
tMap.get("2");
}
}
}
添加Wathch变量到Expression,添加表达式到display如下图:
[img]http://dl2.iteye.com/upload/attachment/0120/5300/360307db-b528-3a19-899e-4c721a55104c.png[/img]
选中某一行,右击,如下图:
[img]http://dl2.iteye.com/upload/attachment/0120/5307/c0967a93-1af9-3a20-a2e2-e88a27cd53d2.png[/img]
//inspect在本行上,显示表达式信息
//watch添加的expression窗口
//diplaly在display窗口显示