Java Documentation class+methods
package com.company;
/**
* @author Rohan kumar sigh dahiwala
* @since 2021
* @version 2.0
* @see <a href = "https://youtu.be/ntLJmHOJ0ME" target="_blank"> Click here </a>
*/
public class CWH_107_methodTags {
/**
*
* @param args These are the arguments supplied to the command line
*/
public static void main(String[] args) {
System.out.println("I am in main method");
// System.out.println(add(2,4));
}
/**
*This is a method which add two integers
* @param a This is the first number to add
* @param b This is the second number to add
* @return Sum of two integers
* @throws Exception if a is 0;
* @deprecated This method is deprecated use second method
*/
public static int add(int a, int b) throws Exception{
if(a==0){
throw new Exception();
}
return a+b;
}
}
Comments
Post a Comment