您能告诉我为什么 IDEA 没有显示以下任何错误吗?这个语法正确吗?当我尝试编译时,它显示错误消息 Error:(24, 37) java: '(' Expected
public class Outer {
class Inner {
Inner() {
System.out.println("hello");
}
}
}
class TestLine {
public static void main(String[] args) {
Outer o = new Outer();
Outer.Inner oi = o.new Outer.Inner(); //This is the line in question
//write way to do it as I know of
//Outer.Inner oi = o.new Inner();
}
}
最佳答案
IntelliJ IDEA 为我显示了正确的错误,并提供了自动修复代码的快速修复。我认为您可能正在运行旧版本的 IntelliJ IDEA。出现the issue已在 IntelliJ IDEA 2019.1 中修复。
关于java - 未显示内部类 Intellij IDEA 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55532333/