New live templates for main methods

Create an instance main method using a live template.

IntelliJ IDEA has some new live templates to add a main method to an implicit class, either with or without arguments: main, maina, psvm, psvma. Using the live templates psvm or main inside a compact source file will add the new main method, while they will continue to add the classic main method inside a class, as you can see in the preview.

Interested in JVM Development?

call to action image

Did you know you can create a compact source file in IntelliJ IDEA?

Learn More


Related Resources

Live templates for simple IO
Live templates for simple IO
Add simple IO methods using live templates.
Live Templates
Live Templates
Use Live Templates to auto-complete common code structures for you.
Inlay Hints
Inlay Hints
Inlay hints provide additional information about your code.