Comments are lines the compiler ignores. You use them to explain why code exists, leave notes for yourself, or temporarily disable code.
A single-line comment starts with //. Everything after it on that line is ignored:
// This prints a greeting
System.out.println("Hello");
A multi-line comment starts with /* and ends with */. Everything between those markers is ignored, even across multiple lines:
/* This is a
multi-line comment */
System.out.println("Hello");
Do not nest multi-line comments. A /* inside another /* */ block causes a compiler error because the first */ closes both.