Eclipse 中快速注释代码有两种方法:1. 键盘快捷键:将光标置于代码行,按 Ctrl + /(Windows/Linux)或 Cmd + /(macOS);2. 上下文菜单:右键单击代码行,选择 "Comment"。
Eclipse 中快速注释代码
在 Eclipse 中快速注释代码有两种方法:
方法 1:键盘快捷键
Ctrl + /(Windows 和 Linux)或 Cmd +
/(macOS)。方法 2:上下文菜单
这两种方法都会在选定的代码行前添加 // 注释符,将代码置为注释状态。如果要取消注释,请再次执行相同操作即可。
其他选项:
Ctrl + /(Windows 和 Linux)或 Cmd + /(macOS)或从上下文菜单中选择 "Comment Block"。Ctrl + /(Windows 和 Linux)或 Cmd + /(macOS)。