Code Fix

初級reached end of file while parsing の原因と直し方 › パターン3

reached end of file while parsing の原因と直し方

波括弧の対応が崩れたときに出ます。

 1  public class Main {
 2      public static void main(String[] args) {
 3          for (int i = 0; i < 3; i++) _
                                        ^
 4              System.out.println(i);
 5          }
 6      }
 7  }
Main.java:7: error: class, interface, enum, or record expected

空欄を埋めてビルドを通す

広告
広告スロット(未設定)

reached end of file while parsing の原因と直し方

エラー行がファイル末尾を指すため、原因箇所の特定にコツが要ります。

このエラーの解説と類題をまとめて見る →

広告
広告スロット(未設定)