[英]Inner Class Intellij IDEA error not shown
你能告訴我為什么 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。 該問題似乎已在 IntelliJ IDEA 2019.1 中得到解決。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.