4. Syntax help
The Eclipse Java editor can help you type and edit your programs. When you type an opening quote or parenthesis, it can put the closing quote or parenthesis in for you and put the focus between them, so that you can type what goes between. In some cases, it will insert a required parenthesis. We use this feature when editing Java code.
You will probably have to change some preferences to get this help. Do it this way. Use
menu-item Preferences -> Java -> Editor -> Typing
A window will open as shown below. Below, you can see which help we use:
1. Automatically close. The editor will close Strings, parentheses, square brackets, angle bracets, braces, and Javadoc and comment regions. We don't add javadoc tags automatically.
2. Automatically insert. The editor will insert semicolons and braces at the correct position.
3. Indentation. Hitting Enter indents the next line properly. Indent this line properly using a the Tab key.
4. Pasting. When you paste text into the file, the editor will adjust indentation properly, and it will also update import statements, adding them where necessary.
5. In String literals. A String literal like "bcd" must appear on one line in Java. If you place your mouse in the middle of such a literal and hit the return (enter) key, Java will automatically change it into two literals, one on each line and with a + operator between them. Neat!