Reached End of File While Parsing

Reached End of File While Parsing

We are searching data for your request:

Forums and discussions:
Manuals and reference books:
Data from registers:
Wait the end of the search in all databases.
Upon completion, a link will appear to access the found materials.

The Java error message Reached End of File While Parsing results if a closing curly bracket for a block of code (e.g, method, class) is missing.

The fix is easy - just proofread your code.


In the code below, the method called main does not conclude with a closing curly bracket. The compiler cannot parse the code properly and will throw the error.

public class Main {
public static void main(String args) {
System.out.println("Oops missed a curly bracket… ");

Avoiding the Error

Because this error is both common and easily avoided, using a code editor like Visual Studio Code or an integrated development environment like Eclipse. Code editors that feature linters and syntax checkers for Java (or whatever language you use) will uncover errors before you attempt to compile.

Video, Sitemap-Video, Sitemap-Videos