Question about comment line in java (eclipse)

What is the difference between this

/** * comment goes here (notice the extra '*' in previous line) */ 

and this?

 /* * comment goes here (notice the extra '*' is not present in previous line) */ 

Because I noticed that in eclipse these two comment styles have different colors . Gets blue color first and the second gets green .

Is there a difference between the two comment styles?

+4
source share
6 answers

The first style is a Javadoc commentary that can be used to create various documentation formats. Eclipse will use them to create tooltips and autocomplete documentation for a documented item.

See the documentation for more details.

+6
source

The first option is to write Java-doc comments. The second is a simple multi-line comment in Java.

+4
source

Comments starting with /** are processed by JavaDoc .

+2
source

/** Comments are used to create Javadoc

/* are simple comments

+2
source

One that turns blue is compatible with the Java Eclipse documentation generator.

+1
source

I think it means distinguishing those that are human from those that are automatically generated.

For example: when u uses the refactor option to implement the interface, the comments above will be green from the first comments. It's just an eclipse agreement

0
source

Source: https://habr.com/ru/post/1345857/


All Articles