Created
August 20, 2017 20:08
-
-
Save tech-andgar/196d2c446e3c586624fa217cdd56bcf6 to your computer and use it in GitHub Desktop.
Example Comment Documentation JAVA
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* <h1>Add Two Numbers!</h1> | |
* The AddNum program implements an application that | |
* simply adds two given integer numbers and Prints | |
* the output on the screen. | |
* <p> | |
* <b>Note:</b> Giving proper comments in your program makes it more | |
* user friendly and it is assumed as a high quality code. | |
* | |
* @author Zara Ali | |
* @version 1.0 | |
* @since 2014-03-31 | |
*/ | |
public class AddNum { | |
/** | |
* This method is used to add two integers. This is | |
* a the simplest form of a class method, just to | |
* show the usage of various javadoc Tags. | |
* @param numA This is the first paramter to addNum method | |
* @param numB This is the second parameter to addNum method | |
* @return int This returns sum of numA and numB. | |
*/ | |
public int addNum(int numA, int numB) { | |
return numA + numB; | |
} | |
/** | |
* This is the main method which makes use of addNum method. | |
* @param args Unused. | |
* @return Nothing. | |
* @exception IOException On input error. | |
* @see IOException | |
*/ | |
public static void main(String args[]) throws IOException { | |
AddNum obj = new AddNum(); | |
int sum = obj.addNum(10, 20); | |
System.out.println("Sum of 10 and 20 is :" + sum); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment