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

后端 未结 7 397
不思量自难忘°
不思量自难忘° 2021-01-30 01:29

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

Is there something similar for public static void main(Str

相关标签:
7条回答
  • 2021-01-30 01:45

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

    This is fastest way.

    0 讨论(0)
  • 2021-01-30 01:49

    This is just main and Ctrl-Space.

    0 讨论(0)
  • 2021-01-30 01:56

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

    0 讨论(0)
  • 2021-01-30 01:56

    As bmargulies mentioned:

    Preferences>Java>Editor>Templates>New...

    Now, type psvm then Ctrl + Space on Mac or Windows.

    0 讨论(0)
  • 2021-01-30 02:01

    Alternately, you can start a program containing the line with one click.

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

    Which method stubs would you like to create?

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

    [check-box] Constructors from superclass

    [check-box] Inherited abstract methods

    0 讨论(0)
  • 2021-01-30 02:07

    In Eclipse, select preferences.

    In preferences, look for Java/Editor/Templates.

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

    0 讨论(0)
提交回复
热议问题