---
schema_version: "1"
id: 36a4a99e1a1ba3e7e7ae3c5dee7dc0301d99d7f2a78d714e15fb863c2ad30226
title: Comments
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexcode/langCon_apex_expressions_comments.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/langCon_apex_expressions_comments.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: ffe4880f43848a6eec7f7b5ecc342a4856084a6c34217b970d99f2a9819577fc
description: Both single and multiline comments are supported in Apex code.
---
# Comments

Both single and multiline comments are supported in Apex code.

![Tip](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/images/icon_note_tip.png)

#### Tip

We recommend using the standardized ApexDoc comment format to increase code readability, collaboration, and long-term maintainability. For the full specifications, see [Document Your Apex Code](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_doc_intro.htm "ApexDoc is a standardized comment format that makes it easier for humans, documentation generators, and AI agents to understand your codebase. We recommend using ApexDoc comments to facilitate code collaboration and increase long-term code maintainability. Based on the JavaDoc standard, ApexDoc provides specifications, such as specialized tags and guidelines, that are tailored to Apex and the Salesforce ecosystem.").

- 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. \*/