Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to use /** */ comment type

 
parul bajaj
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
java has one comment ...

/** */


how to use that please give me one example for this ..

thanks
parul
 
Reghu Ram Thanumalayan
Ranch Hand
Posts: 193
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is the java doc comment. You can use this comment to give information about the class, methods and attributes.

The java doc tool can extract these comments & give you a nice documentation.
 
Arjun K
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Below link directs to javadoc tool.

http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/javadoc.html

Arjun.
 
Rahul Juneja
Ranch Hand
Posts: 425
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Parul,

I think Arjun has allready given you a very good example of Javadoc Comments.

JavaDoc comments are comments which are used by the Javadoc compiler when it uses code comments to prepare Javadocs for the programs developed by you.

Cheers,
Rahul
 
Layne Lund
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by parul bajaj:
java has one comment ...

/** */


how to use that please give me one example for this ..

thanks
parul


BTW, this is not the only style of comment in Java. There are also // and /* ... */ comments that are exactly the same as in C++ (if you are familiar with that language). The // style comments are for a single line. The /* ... */ comments are for multiple lines. As described above, /** ... */ comments have special meaning for the Javadoc tool. You should google to find out what syntax is available for Javadoc-style comments. For one thing, you can include HTML tags since the Javadoc tool generates HTML pages for the documentation. You can also use special Javadoc tages such as @author, @return, @param, and @throws. I suggest you follow the link above to learn more about how to use these Javadoc tags.

Layne
 
Rahul Juneja
Ranch Hand
Posts: 425
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Parul,

Have all this helped you.

Cheers,
Rahul
 
Jeff Bosch
Ranch Hand
Posts: 805
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One more point:

Have you ever read or browsed the Java APIs? They are created with javadoc.
 
Megs Maquito
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
/** * The javadoc tool helps to generate a java documentation.<br> * @author James * @version 1.5 * @Deprecated java.lang.Thread.stop()<br> * @code pack1.SourceCode * @see <a href="http://java.sun.com">clickMe</a> * */ . . . /** * * @return Object * @see package.class#returnInt * @since 1.1 * @throws java.lang.InterruptedException * */public Object returnObj(int one, String str, Object obj) { . . . return obj;}


this is the comment style one should use if one wants an API like html of one's class
 
Megs Maquito
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
oops sori bout my last post the quote did not paste accurately pls check earlier posts.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic