这样注释代码(至少在 Eclipse 中)有什么区别:
/**
* This is a comment
*/
还有这个:
/*
* This is a comment
*/
它以另一种颜色显示。
最佳答案
第一个语法:
/**
* This is a comment
*/
是JavaDoc注释,用于文档,由IDE和文档工具自动解析。
/*
* This is a comment
*/
只是一个普通的 block 注释,当您想编写多行注释时使用。
// This is a comment
只是一个普通的单行注释。
请参阅JavaDoc Documentation在这里。
关于java - 代码注释风格不同,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38281050/