Skip to content

Commenting

Single Line Comments (Rems)

Whatever after the // operator will become a comment within the single line

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

Block Comments (Block Rems)

To have multi-line comments without using the // operator on each line, use the /* <comment> */ syntax

public class HelloWorld {

    /* This is my first line
    This is my second line
    Goodbye! */

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

}