标签:
11. 6 调试技巧
Random random = new Random{
public double nextDouble(){
double result = nextDouble();
Logger.getGlobal().info("nextDouble:" + result);
return result;
}
}
捕获输出流
java MyProg >log.txt
捕获错误流
java MyProg 2>log.txt
同时捕获输出流和错误流
java MyProg >&log.txt
Thread.setDefaultUncaughtExceptionHandler{
new Thread.UncaughtExceptionHandler(){
public void uncaughtException(Thread t, Throwable e){
//save info to file
}
}
}
java系列:《java核心技术 卷1》学习笔记,chapter 11 调试技巧
标签:
原文地址:http://www.cnblogs.com/strinkbug/p/4999758.html