
java - Eclipse comment/uncomment shortcut? - Stack Overflow
Apr 4, 2011 · For single line comment you can use Ctrl + / and for multiple line comment you can use Ctrl + Shift + / after selecting the lines you want to comment in java editor. On Mac/OS X you can use ⌘ + / to comment out single lines or selected blocks.
In Java what is the syntax for commenting out multiple lines?
It is generally better to just comment every line with //. Most IDEs allow you to do this quite simply. ..which is to be done with Ctrl + / in Eclipse. To uncomment, hit it once again. You dan do it for multiple selected lines. Good to know. I don't use it, so I didn't mention about it :) As @kgrad says, /* */ does not nest and can cause errors.
How to Comment and Uncomment code lines in Eclipse editor.
In Eclipse, Code opened in the Java editor. It supports two types of comments. Single-line comments such as //. Multi-Line Comments such as /* */. Following are ways to comment and uncomment. In Editor, Select the code that you want to comment on. Here are shortcuts. use Ctrl + Shift + L to list out all shortcuts.
Eclipse IDE – How to comment and uncomment line & block
Aug 26, 2017 · 1. Shortcut commands in Eclipse IDE : CTRL + / –> to comment single line of code; CTRL + / –> the same works to uncomment the same line of code, which is already commented; CTRL + SHIFT + / –> to comment block of code consisting of 3 or more lines of code; CTRL + SHIFT + \ –> to uncomment block of code, which is already commented
Eclipse comment/uncomment shortcut? - W3docs
To comment out multiple lines at once, select the lines and press Ctrl + / (on Windows) or Command + / (on macOS). To uncomment multiple lines at once, select the lines and press Ctrl + / (on Windows) or Command + / (on macOS) again.
How to comment uncomment single line and block of code in Java …
Aug 17, 2021 · For line comment multiple lines, select multiple lines and press Ctrl + /, it will put // in front of every line. For block commenting in Eclipse, first, select all the lines or code block you want to comment and then enter ctrl+shift+/ it will put /* on the first line and */ on the last line.
Eclipse Shortcut keys & Productivity Tips for Java Developers
Jan 14, 2025 · Usage: Toggles a // comment for the selected line or lines. Shortcut: Simply use the same shortcut (Ctrl + / or Command + /) again on the selected lines to toggle them back to code. Shortcut: Ctrl + Shift + / to start and Ctrl + Shift + \ to end (Windows/Linux).
Java Comments - W3Schools
Multi-line comments start with /* and ends with */. Any text between /* and */ will be ignored by Java. This example uses a multi-line comment (a comment block) to explain the code: Single or multi-line comments? It's up to you which one you use. Normally, we use // for short comments, and /* */ for longer.
Add comments and Javadocs in Eclipse with a single keystroke
May 5, 2010 · Add/remove line comments (//…) from the current line. The position of the cursor can be anywhere on the line. Works with multiple selected lines as well.Alternatively, you can also use Ctrl+Shift+C, which probably works better on a QWERTZ keyboard (eg.
Eclipse Gems, Tips & Tricks: Block Comments | MCU on Eclipse
Jul 23, 2020 · There are many different ways how to comment (or un-comment) multiple lines. As as starter, there is the ‘Source’ menu and context menu for this: select the text and choose. The other (faster) way is using the keyboard shortcuts for the above (<CTRL>+<7>, <CTRL>+<SHIFT>+</> and <CTRL>+<SHIFT>+<\>).