17 January 2013

The Eclipse foreach template

There are many "hidden" features in Eclipse that are really good. Today I discovered the foreach template.

It works like this: place your cursor just above a array or Iterable (List) declaration. Press Ctrl + Space and press Enter. Eclipse will now create a for loop that you can use. It will use the Iterable variable that is closest.

Before:

After:

No comments:

Post a Comment