File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes how to use /**    */ comment type Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "how to use /**    */ comment type" Watch "how to use /**    */ comment type" New topic
Author

how to use /** */ comment type

parul bajaj
Greenhorn

Joined: Apr 26, 2005
Posts: 8
java has one comment ...

/** */


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

thanks
parul
Reghu Ram Thanumalayan
Ranch Hand

Joined: Oct 21, 2003
Posts: 193
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.


Cheers,<br />Reghu Ram T<br /> <br />SCJP 1.4 - 98 %, SCBCD 1.3 - 94 %, SCMAD 1.0 - 92 %
Arjun K
Ranch Hand

Joined: Mar 09, 2005
Posts: 39


Below link directs to javadoc tool.

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

Arjun.
Rahul Juneja
Ranch Hand

Joined: Aug 03, 2002
Posts: 425
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


Rahul Juneja
ThoughtClicks - http://techlabs.thoughtclicks.com
Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
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


Java API Documentation
The Java Tutorial
Rahul Juneja
Ranch Hand

Joined: Aug 03, 2002
Posts: 425
Hi Parul,

Have all this helped you.

Cheers,
Rahul
Jeff Bosch
Ranch Hand

Joined: Jul 30, 2003
Posts: 804
One more point:

Have you ever read or browsed the Java APIs? They are created with javadoc.


Give a man a fish, he'll eat for one day. Teach a man to fish, he'll drink all your beer.
Cheers, Jeff (SCJP 1.4, SCJD in progress, if you can call that progress...)
Megs Maquito
Ranch Hand

Joined: May 18, 2005
Posts: 84
/** * 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


I'm a Hood Ornament
Megs Maquito
Ranch Hand

Joined: May 18, 2005
Posts: 84
oops sori bout my last post the quote did not paste accurately pls check earlier posts.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to use /** */ comment type
 
Similar Threads
PASSED IBM 157 EXAM
non-static block
Disable deploying MDB in ear file in Jboss
Change & sort the contents of JComboBox in Swing
Document Accessors ? A matter of Style