You can use a keyboard shortcut to comment out lines of code in a Java file.

Press Ctrl-Shift-T to comment out the current line or selected lines.

Press Ctrl-Shift-D to remove the comment marks from the current line or selected lines.