Psst.

Wanna make a comment on something?

It’s pretty easy.

Start it with a double slash, //, and anything after that is ignored by the compiler, and you can write whatever you want.

Oh?

You want to say more?

Well, then start your novel with a slash asterisk, /*, and then end it with an asterisk slash, */.

Listing 13-1 Single-line and multiline comments

// Single line comment /* Multi-line    comment */

Oh, and wanna know a cool trick?

If you put a comment before a line of code or wrap it as a multiline comment, you will prevent the program from seeing the code.

That’s called commenting out your code.

Ooooh! And one more thing. There is a shortcut in IntelliJ to do that. Just select the code you want to comment out and press Control-/ or Command-/.

Neat, right?