有的时候,方法直接返回方法值,intellij idea debug时无法查看返回值,比如
static double random(){
//这里,由于直接返回了方法值,无法查看返回值
return Math.random();
}
其实,这种情况intellij idea是支持查看的。
左下角,debugger---->Settings----->勾选show method return values
在对应行设置断点,当执行到断点行时,按快捷键shift+f8
(step out)就可以看到variables面板里有对应的方法返回值了。
必须按shift+f8,F6 虽然也是step out,但是不行