How do I comment blocks of code in Eclipse on a Mac?
Single-line comments in Java start with two forward slashes ( // ). To quickly add a line comment in IntelliJ IDEA, press ⌘ / on macOS or Ctrl + / on Windows and Linux.
Use the cmd + / key binding on the selected code.
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 Cmd + / to comment out single lines or selected blocks.
Apple + Shift + / will toggle a block of selected code using /* */
Apple + / will toggle a line (or multiple, if selected) using //
You may have to disable the OS hotkey (apple + shift + / brings up the help menu)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With