Game.java:6: error: ';' expected
*Game.java → File name
*6 → Error is on line 6
*';' expected → Java expected a semicolon
System.out.println("Hello world");
*System → Built-in Java class
*out → Output stream object
*. → Access operator
*println() → Prints text and moves to the next line
The dots are very important:
System.out.println("Hello");
↑ ↑
Without the second dot:
System.out println("Hello");
Java cannot understand the statement.
The parameter is missing a variable name.
In Java, method parameters need both a type and a name.
*String[] → Type
*args → Parameter name (identifier)
The problem is that after public static, Java expects a return type and a method name.
Java expects class, interface, enum, or record after public.





Top comments (0)