有的时候,方法直接返回方法值,intellij idea debug时无法查看返回值,比如

    static double random(){
    	//这里,由于直接返回了方法值,无法查看返回值
        return Math.random();
    }

其实,这种情况intellij idea是支持查看的。
左下角,debugger---->Settings----->勾选show method return values
在这里插入图片描述
在对应行设置断点,当执行到断点行时,按快捷键shift+f8(step out)就可以看到variables面板里有对应的方法返回值了。
在这里插入图片描述

Logo

一站式 AI 云服务平台

更多推荐