codegurukool.com · Free coding tutorials & online compiler

Home › Java Tutorial › Java syntax

Java syntax

Parts of a Java program.

A class is wrapped in braces. public static void main(String[] args) is the entry point. Statements end with ;. Java is case-sensitive: Main and main are different names. Class names start with a capital letter, variables and methods with a lowercase one.

Example code

public class Main {
  public static void main(String[] args) {
    System.out.println("Syntax");
  }
}

Run this code in the online editor

← Java get startedJava output →