Definition - What does Comments mean?

Comments, in Java, explain the actions of a particular piece of code. They are used to provide a summary of the code in plain English to help future developers better understand the code.

Techopedia explains Comments

There are five types of comments in Java: Block comments give a file or method overview and also may be used within a method. A block comment method is declared as follows: /* *block comment describing the overview of the code. */ Single-line comments are short comments that may be written in a single line. If a single-line comment does not fit in the same line, a block comment must be used. The following is an example of a single-line comment: If (conditional statement) { /* execution of conditional statement*/ ... } /* is the delimiter for a single-line comment. Trailing comments are very short comments written in the same line of code that is being described. The delimiters are /*…*/. End of line comments are written at the end of the line, and the delimiter is //. Documentation comments, written before the declaration, are used to explain Java interfaces, classes, constructors, methods and fields. The delimiters are /**...*/.
This definition was written in the context of Java
Share this:

Techopedia Deals

Connect with us

Techopedia on Linkedin
Techopedia on Linkedin
"Techopedia" on Twitter

Sign up for Techopedia's Free Newsletter!

Email Newsletter

Join thousands of others with our weekly newsletter

The 4th Era of IT Infrastructure: Superconverged Systems
The 4th Era of IT Infrastructure: Superconverged Systems:
Learn the benefits and limitations of the 3 generations of IT infrastructure – siloed, converged and hyperconverged – and discover how the 4th...
Approaches and Benefits of Network Virtualization
Approaches and Benefits of Network Virtualization:
Businesses today aspire to achieve a software-defined datacenter (SDDC) to enhance business agility and reduce operational complexity. However, the...
Free E-Book: Public Cloud Guide
Free E-Book: Public Cloud Guide:
This white paper is for leaders of Operations, Engineering, or Infrastructure teams who are creating or executing an IT roadmap.
Free Tool: Virtual Health Monitor
Free Tool: Virtual Health Monitor:
Virtual Health Monitor is a free virtualization monitoring and reporting tool for VMware, Hyper-V, RHEV, and XenServer environments.
Free 30 Day Trial – Turbonomic
Free 30 Day Trial – Turbonomic:
Turbonomic delivers an autonomic platform where virtual and cloud environments self-manage in real-time to assure application performance.