Version without JavaScript, read-only: workshops, quizzes and running code are not available here. Full version · Catalogue · Sign in

Lecture notes · chapter 8

Splitting and organising code

Packages and the program's entry point.

8.1 Packages

8.2 Entry point (the main function)

A program meant to be executed must have at least one class containing the definition of a main function, named main. Execution starts with this function.

public static void main(String[] args) {
    // instructions to execute
}

The argument args represents the elements passed from the command line of the shell.