Creating JavaDoc With Method Tags
package com.company;
/**
* This class is to demonstrate what javadoc is and how it is used in the java industry
* This is <i>italic</i> word<p>this is a new paragraph</p>
* @author Aryan
* @version 0.1
* @since 2002
* @see <a href="https://docs.oracle.com/en/java/javase/14/docs/api/index.html" target="_blank">Java Docs</a>
*/
public class tuts {
/**
* @param args These are arguments supplied to the command line
*/
public static void main(String[] args) {
System.out.println("I am main method !!");
}
/**
*
* @param i This is the first number to add
* @param j This is the second number to add
* @return Sum of two numbers as integers
* @exception Exception if i or j is more than 2147483647
*/
public int add(int i, int j) throws Exception {
if (i==2147483647) {
throw new Exception();
}
if (j==2147483647) {
throw new Exception();
}
int c;
c = i + j;
return c;
}
}
Comments
Post a Comment