java - Difference between comments /* */ and /** */? -


this question has answer here:

what difference between below comments in eclipse:

  1. / followed 1 *

    /* comments... */

  2. / 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

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -