Home
Dictionary
Tags
Development
Comments
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.
Posted by:
Cory Janssen
Tweet
Tweet
Related Terms
Hypertext Markup Language Comment (HTML Comment)
Comment
Request for Comments (RFC)
Java
Related Videos
Related Links
Related White Papers
Other Resources
Related Tags
Categories:
Development
Java
Recommended For You
close
Gaming Principles and the Future Virtual World
Read More
»
Connect with us
Techopedia on Linkedin
Follow us on LinkedIn
Techopedia on Twitter
'@Techopedia'
Sign up for Techopedia's Free Newsletter!
Sign-In
Join Techopedia
Home
Dictionary
Articles
Tutorials
Newsletters
Menu
Home
Dictionary
Articles
Tech 101
How To
5 Things
IT Careers
History of Tech
Tutorials
Hot Trends
Big Data
Windows 8
Security
Cloud Computing
Data Centers
Mobile Computing
CRM
Green IT
Storage
Virtualization
Online Privacy
Job Roles
Developers
Network Admins
Database Admins
Tech Support
IT Management
Water Cooler
Infographics
Who To Follow
All Topics
Hacking
Online Marketing
Buzzwords and Jargon
Viruses
Operating Systems
Legal
People
Search Engines
World Wide Web
Personal Tech
Gaming
Linux
Internet