Transferred from: http://www.cnblogs.com/SharkBin/p/3999804.html
1. File Header Comment
Each file header must be a file header comment. Examples of file header annotations are as follows:
/* * File name: loginactivity*: for user *: * Time : * Version right: */
2. Method Header Comment
Each method header of a member method, including a custom member method, overriding method, property method, must make a method header comment.
Examples of custom member method annotations are:
/*
* Method Name: Login_click (View v)
* Function: Click the Login button event
* Parameters: View V-button view
* Return value: None
*/
Examples of overriding (overriding) member method annotations are as follows:
Examples of property getter and setter member method annotations are as follows:
3, block comment
Make a block comment before implementing the code for a phased function. A comment example for a block comment is as follows:
4. Variable Comment
All member variables and most local variables need to be commented on when declaring them.
A comment example of a member variable comment is as follows:
A comment example of a local variable comment is as follows:
5. Statement comment
Make a single statement comment to the right of the key statement.
A comment example of a statement comment is as follows:
6. Other Notes on the note
(1) File header and method header comments should use/**/form, variable comments and statement comments should use//form, block comments should try to use//form, when the text is longer (single horizontal can not be displayed completely) block annotations can also use the/**/form;
(2) The amount of comments must be not less than one-third of the total code;
Java and Android Annotation specifications