Code templates.

Using a tool makes life a lot easier, certainly if you learn said tool to the fullest.

Modern code editors, like NetBeans-IDE can be programmed to take some of your typing work.
Things that you type more often can be reduced to typing just a shortcut, which the IDE will expand into the full text.

You can try it yourselves.

Let’s Try:
In the mooc course, you will quite often need to read an integer from the console using a predefined Scanner object. The shortcut below will help you do that quite quickly.

Go to options →(settings in Mac-OSX) →edit →Code Templates.+ Then click new and type readi as name and abbreviation.
Insert the following text into the code window:

int ${cursor}number = Integer.parseInt(${EXP instanceof=extends java.util.Scanner}.nextLine());
My most popular shortcut is the one below, called jutm, which creates a junit test method
public void test${Method}() {
    fail("test method test${Method} not yet implemented");

You may also want to have a look at the video by Geertjan Wielenga on this topic. There is also a cheat-sheet to view and manage your code templates.

Using code templates in NetBeans IDE