Interpretation notes

After any language can basically run, the basic grammar learning is necessary. Today we set sail from the annotation! ! !

Annotation: Namely mark and explain.

solved problem:

Under the premise that a few simple lines of code or simple logic do not need to be shared, the program written by oneself can definitely be understood. But when the project structure becomes complicated and involves the cooperation of team members, it is very necessary to comment the written code in time.

Features of annotations:

For developers to read, it will not be executed, so a special format is specified during the code writing process

As a developer, remind me that we must develop the habit of writing notes.

Three manifestations of comments:

  1. Single line comment (Line comment) Format: // Comment content Only one line of text can be commented
  2. Multi-line comment (Block comment) Format: /* Comment content*/ You can wrap, and you can comment a paragraph of text
  3. Document comments (JavaDoc) Format: /**Comment content*/

 

 

Easter eggs: the difference between annotation and comments

Annotation:

Comments:

 

Guess you like

Origin blog.csdn.net/sinat_40775402/article/details/113008366