Java TutorialLesson 6Free preview
Java Comments
This lesson is part of Java · All levels
Summary
This lesson explains how to write comments in Java code as notes that the compiler ignores. There are one-line comments with //, multiple-line comments with /* */, and documentation comments with /** */. Commenting helps to keep the code easy to understand without affecting the outcome of program execution.
Key points
- One line commentary is written with two slashes //
- Comments are wrapped in many lines at the beginning and at the end
- Documentation commentary is used to describe a class or method so that it can be automated.
- The compiler ignores the comments so that the comments do not change the program's behavior
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.