swift用注释一些不执行的文本,作为注解或者提醒暗示。 注释 不被编译器编译。注释和C语言很相似。
单行注释用“ / /”
例如: / /this is a comment
多行注释用“ /*”开始,“* /” 结尾。
例如: /* this is also a comment,
but written over multiple lines */
不像C语言,多行注释可以嵌套的。嵌套注释可以注释 大块代码。即使这些代码已经被注释了。
例如:
/* this is the start of the first multiline comment
/* this is the second, nested multiline comment */
this is the end of the first multiline comment */