What is the name of the method that serves as the entry point of a Java program?

The story behind the answer

The method named `main` serves as the traditional entry point of a Java program.

A conventional Java application starts with a method such as `public static void main(String[] args)`. The Java launcher loads the chosen class, locates a compatible `main` method, and invokes it. The `String[] args` parameter receives command-line arguments, while `static` allows the method to run without first creating an object.

`init`, `start`, and `run` can be meaningful method names in particular frameworks, but they are not Java’s general application entry point. For example, `run` is associated with threads, while `start` begins a thread’s execution and eventually causes its `run` method to execute.

Modern Java versions also support simplified main-method forms for compact source files, but `main` remains the defining name. Java’s entry point must be placed in a class or supported unnamed-class source file.

Source: Wikipedia · fact-checked Aug. 2026

Add question to a list

Choose a list to keep this question in: