註釋概述:用於解釋說明程序的文字;
註釋分類:
1、單行註釋://註釋文字
快捷鍵:點擊所在行使用下面快捷鍵進行註釋或解注;
- 註釋:Ctrl + /
- 解注:Ctrl + /
//System.out.println("輸出HelloWorld!");
2、多行註釋:/* 註釋文字 */
快捷鍵:選中需要註釋的代碼,使用下面快捷鍵進行多行註釋和解注;
- 註釋:Ctrl + Shift + /
- 解注:Ctrl + Shift + \
/*
*System.out.println("輸出HelloWorld!");
*System.out.println("輸出HelloWorld!");
*/
3、文檔註釋:/** 註釋文字 */
在類上面用來對整個文件的解釋。
/**
*
* @CreateTime 2020年6月5日 上午10:30
* @author Chen
* @Description 項目
*
*/
public class Service {
}
單行註釋可以嵌套,多行註釋不可以嵌套。