Skip to content

Errors and comments

Read · 1 of 5

The compiler checks your code first

Before anything runs, javac reads your whole program. If something's wrong it stops and tells you the line number and the problem.

Common beginner mistakes: a missing semicolon, a missing quote or bracket, or wrong capitals (Java cares: System, not system).

1Main.java:3: error: ';' expected
2 System.out.println("Hi")
3 ^
41 error