Abstract
Psst.
You have full access to this open access chapter, Download chapter PDF
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?
Author information
Authors and Affiliations
Rights and permissions
Copyright information
© 2021 Doug Winnie
About this chapter
Cite this chapter
Winnie, D. (2021). Comments and Whitespace. In: Essential Java for AP CompSci. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-6183-5_13
Download citation
DOI: https://doi.org/10.1007/978-1-4842-6183-5_13
Published:
Publisher Name: Apress, Berkeley, CA
Print ISBN: 978-1-4842-6182-8
Online ISBN: 978-1-4842-6183-5
eBook Packages: Professional and Applied ComputingApress Access BooksProfessional and Applied Computing (R0)