java - Difference between comments /* */ and /** */? -
this question has answer here:
what difference between below comments in eclipse:
/ followed 1 *
/* comments... */
/ followed 2 **
/** comments... */
the color of both comments different. , when use 2nd type comment automatically displays @author
name. why this?
the /** */
comments javadoc comments, more details here:
documentation comments (doc comments)
the special comments in java source code delimited /** ... */ delimiters. these comments processed javadoc tool generate api docs.
their specific formatting lets tools build api documentation the 1 see of standard package also, if run it, of own code. lets describe in formal way arguments, returned, etc.
not documentation presented when generate (as html or in format), it's presented in ide eclipse in multiple ways, example when mouse hovers names. it's important practice write in javadoc important information needed users of methods , class (and no more what's useful).
it's mention /* */
useful not commenting-out multiple lines. consider situation when want comment-out inside if
condition:
if(a==b && c == d)
then if want remove a==b
, put later on, can't use //
because it'll comment-out whole line after it, do:
if(/*a==b &&*/ c == d)
by way, has nothing eclipse, that's java feature.
Comments
Post a Comment