A quick guide to find and use the shortcut key to launch System.out.println() statement in eclipse.
In this tutorial, we'll learn how to launch and shortcut for system.out.println in eclipse for java development.
Usage of System.out.println() is very useful to debug the program easily when you are doing the application development or learning phase.
But it is recommended to use Log4j or slf4j api for logging the relevant info in production environments.
All shortcuts showin in this article will work for windows and mac os x operating systems eclipse versions.
2. System.out.println shortcut in eclipse using syso or sys
To auto populate the system.out.println, you just need to type the syso then press control + enter keyboard shortcut key combination to show the complete option.
Look at the below screenshot for better understanding and follow the step along with.
If you are using the latest eclipse editors then just type only "sys" and then presss ctrl + enter key.
Then it will show the few more options for error and out message as below.
Once you select sysout from the auto complete options then it will fill the full system.out.println statement as below.
3. System.out.println shortcut in eclipse using sysout
If you do not want to see the options for error and out like above then just type complete word "sysout" then press control + enter.
This shortcut will add directly full system.out,println without any delay.
4. System.out.println shortcut in eclipse using sout
The latest eclipse versions are added with the new shortcut key "sout" then press control + enter.
sout also direclty generates system.out.println.
5. System.out.println shortcut from templates
If any one of the above shortcuts are not working for you, it is better to check the right key mapped for this system.out.println statement in eclipse templates.
Windows eclise version: window --> preferences --> java --> Editor --> templates
Mac os x eclise version: Eclipse --> preferences --> java --> Editor --> templates
Look at the below template settings.
In tihs article, we've seen the different ways to open the short cut for system.out.println in eclipse for mac and windows versions.