fastread homefastrread library fastread menu

Java : Creating API Document | javadoc tool

Tutorial by:Arena Buocel      Date: 2016-04-30 00:20:01

❰ Previous Next ❱

We can create document api in java by the help of javadoc tool. In the java file, we must use the documentation comment /**... */ to post information for the class, method, constructor, fields etc.

Let's see the simple class that contains documentation comment.

  1. package;  
  2. /** This class is a user-defined class that contains one methods cube.*/  
  3. public class M{  
  5. /** The cube method prints cube of the given number */  
  6. public static void  cube(int n){System.out.println(n*n*n);}  
  7. }  

To create the document API, you need to use the javadoc tool followed by java file name. There is no need to compile the javafile.

On the command prompt, you need to write:


to generate the document api. Now, there will be created a lot of html files. Open the index.html file to get the information about the classes.

❰ Previous Next ❱


Submit Your Thought, Tutorial, Articls etc.

Submit Your Information India's Number one online promotion website