In IDEA, you can use shortcut keys /**
to quickly generate /** 内容 */
comments.
Ctrl + /
To use this shortcut, press (Windows) or Command + /
(Mac) on the line of code you want to comment . If you want to undo the comment, just press the shortcut key again.
Note that you must be at the beginning of a line of code to use this shortcut. If you use the shortcut key elsewhere in the line of code, it will not take effect.
Shift + Ctrl + /
In addition, you can also use (Windows system) or Shift + Command + /
(Mac system) shortcut keys in IDEA to generate block comments, that is, /* */
comments. You can select multiple lines of code and then use this shortcut to wrap the selected code in a comment.