简体   繁体   English

如何在 IntelliJ 的调试器中判断局部变量的类型?

[英]How can I tell the type of a local variable in IntelliJ's debugger?

// from Selikoff and Boyarsky Java 17 certification
public class Ex0 {
    public static void main(String[] args) {
        short x = 10;
        short y = 3;
        var z = x * y;
    }
}

I want to tell what the type of the var is but I do not see it in the debugger.我想知道 var 的类型是什么,但我在调试器中看不到它。

Even the types of x and y are not shown.甚至没有显示 x 和 y 的类型。

想法

You can right click on IntelliJ's debugger tool window, select "Customize Data Views", and enable "Declared type".可以在IntelliJ的调试器工具window、select右击“Customize Data Views”,启用“Declared type”。

显示声明的类型

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM