Every Java program needs at least one class. Code is organized neatly inside blocks { }, and every statement must end with a semicolon ;. Java is case-sensitive, so Main and main are not the same. Java keeps very close track of capitalization—it's basically in exam-invigilator mode at all times.
public class Main {
public static void main(String[] args) {
// Program starts here
System.out.println("Hello World");
}
}public class Main is a class declaration. public static void main(String[] args) is the main method of a Java program, and it's the method the JVM looks for and runs first. A comment line starting with // isn't code—it's just a note left by the developer.
Hello WorldReal-world use
Once you're comfortable with the syntax, you'll pick up much faster on "which block handles which responsibility" when reading framework code later on.