# Commenting and uncommenting lines of code

To toggle line comments (`// comment`) in the Java editor:

- Select the lines you wish to comment or uncomment, or set the caret into a line
- Do one of the following:
  - Press `Ctrl+/` or
  - Select Source > Toggle Comment from the menu bar

To insert a block comment (`/*comment*/`) in the Java editor:

- Select the text range you wish to comment
- Do one of the following
  - Press `Ctrl+Shift+/` or
  - Select Source > Add Block Comment from the menu bar

To remove a block comment (`/*comment*/`) in the Java editor:

- Select the text range you wish to uncomment or set the caret into a block comment
- Do one of the following
  - Press `Ctrl+Shift+\` or
  - Select Source > Remove Block Comment from the menu bar

Java editor

Using the Java editor

Source menu