Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Java syntax
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Comments=== Java has three kinds of [[Comment (computer programming)|comments]]: ''traditional comments'', ''end-of-line comments'' and ''documentation comments''. Traditional comments, also known as block comments, start with <code>/*</code> and end with <code>*/</code>, they may span across multiple lines. This type of comment was derived from C and C++. <syntaxhighlight lang="java"> /* This is a multi-line comment. It may occupy more than one line. */ </syntaxhighlight> End-of-line comments start with <code>//</code> and extend to the end of the current line. This comment type is also present in C++ and in modern C. <syntaxhighlight lang="java"> // This is an end-of-line comment </syntaxhighlight> Documentation comments in the source files are processed by the [[Javadoc]] tool to generate documentation. This type of comment is identical to traditional comments, except it starts with <code>/**</code> and follows conventions defined by the Javadoc tool. Technically, these comments are a special kind of traditional comment and they are not specifically defined in the language specification. <syntaxhighlight lang="java"> /** * This is a documentation comment. * * @author John Doe */ </syntaxhighlight>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)