Which method of commenting is most widely accepted or does it really matter?
I have been using
/** * (Method description) * @param * @return * etc */
However I have read of:
Precondition: Postcondition:
Is there a more 'professional' way of commenting?
Java Multi-line Comments Multi-line comments start with /* and ends with */ . Any text between /* and */ will be ignored by Java.
Java programs can have two kinds of comments: implementation comments and documentation comments. Implementation comments are those found in C++, which are delimited by /*... */, and //. Documentation comments (known as "doc comments") are Java-only, and are delimited by /**...
In Java there are three types of comments:Single-line comments. Multi-line comments. Documentation comments.
The Java code conventions are defined by Oracle in the coding conventions document. In short, these conventions ask the user to use camel case when defining classes, methods, or variables. Classes start with a capital letter and should be nouns, like CalendarDialogView .
Here are the Java coding conventions for comments recommended by Oracle:
Here are Google's recommendations for their Android platform:
For more detailed information on style and conventions for Javadoc, see here:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With