Note is an explanation of a function or a line of code.
Note will not be executed (only valid in the Java source file, the compiler will automatically ignore it and will not be compiled to the class bytecode file). Essence
Writing comment is a good habit.
- Single comments (LINE Comment): //
- multi -line comments (block comment): /* */
- documentation (javadoc):
/**
*Note content
*/
Note:
Annotations annotation
Comments
Perhaps there may be two situations:
-
Multi -line annotation can be nested with one -line annotation
/*int C = 10; // Define a integer C; int x = 5;*/
-
Multi -line comments cannot be nested with multi -line notes
/* /*int c=10;*/ */
Reason: This situation cannot be compiled by the code, the first “/*” will be the first “/”pairing, resulting in the second”/”Can’t find a pairing, and will compile failure.
Note:
Therefore, it is usually avoided in actual development. Code annotations are avoided. Only under special circumstances can nested use of single notes in multi -line comments.
File→Settings→Editor→Color Scheme→Java
Select Comments → Three: Block Comment, Javadoc, LINE Comment
The right panel is the notation color and style: Bold black body/thick body italic oblique body
When custom settings, you need to remove the default inheritance below first:
Otherwise, the settings cannot be modified.
Apply
OK
2 2 2 2 2:Interesting code
https://zhuanlan.zhihu.com/p/103508033
Too cute
You can go and see if you have time.