-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJava_Doc.java
More file actions
42 lines (40 loc) · 1.16 KB
/
Copy pathJava_Doc.java
File metadata and controls
42 lines (40 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package BASICS;
//Search Oracle JavaDoc for more info on this
/**
*This is a Java Documentation File, where we will learn various ways to implement JavaDoc
* This is <i>italic</i> word<p>This is a new paragraph</p>
* @author Harshit
* @version 0.1
* @since 2022
*@see <a href = "https://docs.oracle.com/en/java/javase/14/docs/api/index.html" target = "_blank">Java Docs</a>
*/
public class Java_Doc{
/**
*
* @param a - first Number
* @param b - Second Number
* @return sum of the inputs
* @throws Exception if a or b is 0
* @deprecated This method is deprecated please use + Operator
*/
public int add(int a, int b) throws Exception{
if(a == 0 || b == 0)
throw new Exception();
System.out.println("the sum is " + (a+b));
return a+b;
}
/**
* Hey this is Harshit
* @param args This is the command line argument
*/
public static void main(String[] args) {
System.out.println("This is my main method");
Java_Doc j = new Java_Doc();
try {
j.add(0, 4);
}
catch(Exception e){
System.out.println(e);
}
}
}