# Commenting

Source: https://cca.twango.dev/AP-Computer-Science/commenting

# Commenting

## Single-line comments (rems)

Text after `//` is a comment until the end of that line.

```java
System.out.println("Hello!"); // This line prints "Hello!"
```

## Block comments (block rems)

Use `/* ... */` for a comment spanning multiple lines.

```java
public class HelloWorld {
    /* This is my first line
       This is my second line
       Goodbye! */

    public static void main(String[] args) {
        System.out.println("Wow!");
    }
}
```

Related: [[introduction-to-java|Introduction to Java]]
