Our last series was a big success and we decided to take it a step further with an Advanced Programming series, which will start in Dec. 2016. But for today I want to give you a quick tip for faster coding in IntelliJ IDEA!When you are coding, there are some constructs that you might type more than once. Let’s say the main-method. Each Java program needs one, or the System.out.println()-call, which might be a method you call very often. IntelliJ (as well as other IDEs) have handy features, so you do not have to write these constructs manually each time you need them. For example:
If you type in sout in a valid context (inside a method) and press enter immediately after entering it, IntelliJ will substitute “sout” with:
System.out.println("");
Look at this short video if you want to see this feature in action!
These keywords are called live templates in IntelliJ and you can list all available keywords with the Ctrl + J (Cmd + J on Mac) shortcut. You can read more about live templates in the official documentation.
And the best thing is: If you have a code snippet that you use often, you can define your own macros! Learn about that feature here.
Hopefully this tip helps you and speeds up your coding! Have a nice Monday!
Table of contents
Part 1 – MyFirstProgram
Part 2 – Access Modifiers and Variables
Part 3 – Methods
Part 4 – Arrays
Part 5 – Control flow
Part 6 – Classes and Objects
Part 7 – Exceptions and exception handling
Addendum 1 – IntelliJ QuickTip (You are here)
Addendum 2 – Important programming concepts explained
18 thoughts on “Programming Basics – Addendum: IntelliJ QuickTip”