DekGenius.com
Previous Section  < Day Day Up >  Next Section

Recipe 3.16 Commenting Out a Section of Code

3.16.1 Problem

You want to comment out a long section of code.

3.16.2 Solution

Select Source Comment.

3.16.3 Discussion

All you have to do is to select the lines to comment out and then select Source Comment. A single-line comment, //, will appear in front of all the lines. To uncomment them, just select Source Uncomment.

3.16.3.1 Eclipse 3.0

Eclipse 3.0 also enables you to surround code in a block comment (/*...*/). Just select Source Add Block Comment. To remove the comment, select Source Remove Block Comment.

3.16.4 See Also

Chapter 2 of Eclipse (O'Reilly).

    Previous Section  < Day Day Up >  Next Section