|
Language |
In-line comment |
Block comment |
|
C (C99), C++, Go, and JavaScript |
// InlineComment |
/* BlockComment */ |
|
CSS |
/* 注释内容 */ |
/* 注释内容 */ |
|
HTML |
<!--注释内容- -> |
<!--注释内容- -> |
|
Java |
// InlineComment |
/** BlockComment */ (Javadoc documentation comment) |
|
Matlab |
% InlineComment |
%{ |
|
PHP |
# InlineComment |
/* BlockComment */ |
|
PL/SQL and TSQL |
-- InlineComment |
|
|
Python |
# InlineComment |
''' BlockComment ''' (Documentation string when first line of module, class, method, or function)
|
参考:
https://en.wikipedia.org/wiki/Comparison_of_programming_languages_%28syntax%29#Comments
本文概述了多种编程语言中的注释语法,包括单行注释和块注释的不同形式,并提供了示例代码。涉及的语言有C/C++, Go, JavaScript, CSS, HTML, Java, Matlab, PHP, PL/SQL, TSQL及Python等。
712

被折叠的 条评论
为什么被折叠?



