From the course: Learning Eclipse

Unlock the full course today

Join today to access over 22,700 courses taught by industry experts or purchase this course individually.

Code templates

Code templates

From the course: Learning Eclipse

Start my 1-month free trial

Code templates

- [Instructor] Another one of my favorite features in Eclipse are code templates, some other IDE's refer to them as code snippets. These code templates help reduce typing time by inserting code into the editor, and each code template is given a short literal, and typing that literal into the editor window and pressing control-space brings up a dialog box with which a code template associated with that literal can be selected, so, basically, let's go to inside this main method and type in something like, "while". If I hold the control key down and hit space, you can see some code templates that are associated with that, so, I can hit the down arrow, and I'll see a preview of what the template will look like. If I hit down again, this one is for iterate with iterator, the next one is while loop with condition. Let's go ahead and choose the first one. I hit enter, and the snippet automatically shows up. Let's try another one: "for", control-space, the first option is iterate over array…

Contents