Add arguments

Add args to your main method.

The new void main() method, introduced in Java 25, does not need String[] args. However, should you decide to use the args in your code, IntelliJ IDEA will help you by also adding them to the main method. Type args and press (macOS) / Enter (Windows/Linux) to select args from code completion.

Interested in JVM Development?

call to action image

Complete statement is just one of many completions offered by IntelliJ IDEA!

Learn More

Related Resources

Compact source file
Compact source file
Create a compact source file in IntelliJ IDEA.
Convert compact source file to class
Convert compact source file to class
Convert a compact source file to a class in IntelliJ IDEA.
Download a JDK
Download a JDK
Download or associate a JDK with your project.