September 30, 2013

How to create javadoc using eclipse ide

How to create developer documentation for a java project


Documentation Comments are essential for every source code in industrial projects. Documentation comments represented by ( /** … */) are unique to java. You can create html developer document for your project once you properly comment your code. Here ,i am going to show you how to create javadoc for your project.

Create a java project in eclipse, Copy and paste the below code to your source folder
/**
* Filename :  ArithmeticOperations.java
* Author   :  belazy1987atgmail.com
* Date      :  September 19 1987
* Description : A java program that shows Basic Arithmetic Operations
*/

/**@author nick +Karthick Rajendran 
 * @version 1.0
*/
public class ArithmeticOperations {
/**  To store answers with double DataType
 */
private double answerDouble = 0.0d;
/**
 *   To store answers with float DataType
 */
private float answerFloat = 0.0f;
/** To store answers with int DataType
 */
private int ansInt = 1;
/** addition() is used to add two variables
 *  @param value_one  first parameter
 *  @param value_two  second parameter
 *  @return answerDouble  returns the sum of value_one and value_two
 */
private double addition(double value_one, double value_two) {
 answerDouble = value_one + value_two;
 return answerDouble;
}

/** subtraction() is used to subtract and return the result
 *  @param value_one first parameter
 *  @param value_two second parameter
 *  @return answerFloat returns the difference of value_one and value_two
 */
private float subtraction(float value_one, float value_two) {
 answerFloat = value_one - value_two;
 return answerFloat;
}

/** multiplication() is used to multiply two values
 *  and return the result
 *  @param value_one first parameter
 *  @param value_two second parameter
 *  @return ansInt returns the product of value_one and value_two
 */
private int multiplication(int value_one, int value_two) {
 ansInt = value_one * value_two;
 return ansInt;
}

/**division() is used to division
 *  and return the result
 *  @param value_one first parameter
 *  @param value_two second parameter
 *  @return ansInt returns the quotient after dividing value_one with value_two
 */
private int division(int value_one, int value_two) {
 ansInt = value_one / value_two;
 return ansInt;
}

/** showDetails() is used to display the output
 *  @param ansAdd  Output of addition
 *  @param ansSub  Output of subtraction
 *  @param ansMul  Output of multiplication
 *  @param ansDiv  Output of Division
 */
private void showDetails(double ansAdd, float ansSub, int ansMul, int ansDiv) {
 System.out.println(" Addition : " +ansAdd);
 System.out.println(" Subtraction : " +ansSub);
 System.out.println(" Multiplication : " +ansMul);
 System.out.println(" Division : "+ansDiv);
}

/**
 * main() function
 * @param str user can pass parameters to main through command prompt
 */
public static void main(String[] str) {
 ArithmeticOperations arithmeticOperation = new ArithmeticOperations();
 double ansAdd = arithmeticOperation.addition(10.0,20.0);
 float ansSub = arithmeticOperation.subtraction(20.8f,12.3f);
 int ansMul = arithmeticOperation.multiplication(200,10);
 int ansDiv = arithmeticOperation.division(100,10);
 arithmeticOperation.showDetails(ansAdd,ansSub,ansMul,ansDiv);
}

/**
 *  belazy1987atgmaildotcom
 */
}

read more 
 
 
Created a html document for the project you had coded 
 
 Thanking you.........

Facebook comments