Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to auto-complete main() in eclipse?

Tags:

java

eclipse

I am using Eclipse Helios. I am wondering if there is anyway to add the main() method quickly in Eclipse?

like image 747
user705414 Avatar asked Dec 25 '11 05:12

user705414


People also ask

How do I autocomplete system out Println in Eclipse?

To get System. out. println() line in eclipse without typing the whole line type sysout and press Ctrl + space.

What is the shortcut for main in Eclipse?

To get public static void main(String[] args) line in eclipse without typing the whole line type main and press Ctrl + space then, you will get the option for the main method select it.

How do I enable Content Assist in Eclipse?

To enable the Content Assist window to open automatically, go to the Content Assist Preferences page, accessed from Window | Preferences | PHP | Editor | Content Assist and mark the 'Enable auto-activation' checkbox.


2 Answers

Type

main 

then your content assist shortcut key.

enter image description here


You can also add a main method from the class creation wizard. There's a checkbox to have it put in a main method for you. – rfreak

like image 105
Matt Ball Avatar answered Oct 06 '22 21:10

Matt Ball


This is just main and Ctrl+Space.

Or

type ma and then press ctrl+space

Or

type m and then press ctrl+space.

like image 25
Girish K Avatar answered Oct 06 '22 19:10

Girish K