How to add by default Static void main?

Answered

Like in Eclipse, when we create the new class, there is the option to add Static void main line, the same way, how can I add this to IntelliJ Java CE whenever create the new class?

3 comments
Comment actions Permalink

You can edit Class file template and add a method there or create a new template like Class with Main.

Or just type "psvm" and press Tab after creating a class.

4
Comment actions Permalink

Thanks psvm works fine.

0
Comment actions Permalink

You can also check this site if you want to set psvm up as part of your java class template: https://www.jetbrains.com/help/idea/using-file-and-code-templates.html

Pretty much you have to go to File/ Settings/ Editor/ File and Code Templates, then select Class from the list of files and include in the code the psvm structure:

public static void main (String[] args) {

}

Hope it was helpful! :)

0

Please sign in to leave a comment.