What is the Eclipse shortcut for "public static void main (String args [])"?

I know a cool shortcut for System.out.println() : sysout Ctrl + Space .

Is there something similar for public static void main(String args[]) ?

+88
java eclipse main keyboard-shortcuts
Oct 18 '11 at 20:18
source share
6 answers

This is just main and Ctrl - Space .

+209
Oct 18 '11 at 20:22
source share

In Eclipse, select the settings.

In the settings, find Java / Editor / Templates.

Here you will see a list of all of them. And you can even add your own.

+48
Oct 18 '11 at 20:21
source share

Just enter ma and press Ctrl + Space , you will get an option for it.

+19
Feb 04
source share

As mentioned by bmargulies:

Settings> Java> Editor> Templates> New ...

enter image description here

enter image description here

Now enter psvm then Ctrl + Space on Mac or Windows.

+5
Oct 28 '16 at 15:04
source share

Type main , press and hold Ctrl , then press Space Space (double space) and select it or press enter to focus on the main option.

This is the fastest way.

+1
Apr 15 '17 at 15:34
source share

Alternatively, you can run a program containing a one-click line.

Just select the stub method for it when creating a new Java class that says code,

What method stubs would you like to create?

[check-box] public static void main (String [] args) <---- Select this.

[check-box] Constructors from the superclass

[check-box] Inherited abstract methods

0
Sep 21 '15 at 17:12
source share



All Articles