Using Comments

Both single and multiline comments are supported in Apex code:

  • To create a single line comment, use //. All characters on the same line to the right of the // are ignored by the parser. For example:
    Integer i = 1; // This comment is ignored by the parser
  • To create a multiline comment, use /* and */ to demarcate the beginning and end of the comment block. For example:
    Integer i = 1; /* This comment can wrap over multiple
                      lines without getting interpreted by the 
                      parser. */
Previous
Next