Skip to content

Comments

Comments are ignored by the compiler. Use them to annotate your code.

Single-line comments

Start with // and continue to the end of the line:

// this is a comment
var int x = 42  // inline comment

Multi-line comments

Wrapped in /* and */:

/* This is a
   multi-line comment.
   It can span as many lines as needed. */

Multi-line comments do not nest. The first */ encountered closes the comment.