Whitespace is for humans, case is for Java
Odd spacing still compiles, because statements end at semicolons. score and Score are two different variables.
Every Java program lives inside a class, starts running at the main method, and is made of statements that end with semicolons, grouped into blocks with curly braces. This topic explains every word of public static void main(String[] args) and of System.out.println, plus comments, names and the rules the compiler enforces.
Change the code and press Run (Ctrl+Enter). Try to predict the output first, then break it on purpose and read the error. Your edits are saved and match the lesson page.
Practice questions
Write the code in the editor, run it, then open the model answer to compare.
Write a program with a Javadoc comment on the class, a block comment, and a line comment, that prints Comments done.
Write a program that prints how many command-line arguments it received, and run it locally with three arguments.
This program has three mistakes. Fix them: public class main { public static void Main(String[] args) { System.out.println("Fixed") } } (the file is Main.java).
Explain it without notes
Explain each word in public static void main(String[] args).
What is the difference between a statement and a block?
Why is main static?
Break down System.out.println("Hi") into its parts.
Expected output
One
Two
Three
score = 10
Score = 99