File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ public class Demo {
2+
3+ public static void main (String [] args ) {
4+ System .out .println ("Hello Madan" );
5+ }
6+
7+
8+ /**
9+ * Adds two numbers
10+ * @param a the first number
11+ * @param b the second number
12+ * @return the sum of the two numbers
13+ */
14+ public static int add (int a , int b ) {
15+ System .out .println ("Sum: " + (a +b ));
16+ return a + b ;
17+ }
18+
19+ /**
20+ * Subtracts two numbers
21+ * @param a the first number
22+ * @param b the second number
23+ * @return the difference of the two numbers
24+ */
25+ public static int subtract (int a , int b ) {
26+ System .out .println ("Difference: " + (a -b ));
27+ return a - b ;
28+ }
29+
30+ /**
31+ * Multiplies two numbers
32+ * @param a the first number
33+ * @param b the second number
34+ * @return the product of the two numbers
35+ */
36+ public static int multiply (int a , int b ) {
37+ System .out .println ("Product: " + (a *b ));
38+ return a * b ;
39+ }
40+
41+ /**
42+ * Divides two numbers
43+ * @param a the first number
44+ * @param b the second number
45+ * @return the quotient of the two numbers
46+ */
47+ public static double divide (int a , int b ) {
48+ System .out .println ("Quotient: " + (a /b ));
49+ return (double )a / b ;
50+ }
51+
52+
53+ }
You can’t perform that action at this time.
0 commit comments