-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMethodover.java
More file actions
40 lines (35 loc) · 872 Bytes
/
Copy pathMethodover.java
File metadata and controls
40 lines (35 loc) · 872 Bytes
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
/*
NAME : TANMAY SANJAY GAIDHANI
CLASS : SY'A'
BATCH : I
ROLL NO: 114
*/
public class Methodover
{
static int method(int x,int y)
{
int z=x+y;
return z;
}
static double suha(double a,double b)
{
double k=a-b;
return k;
}
public static void main(String[] args) {
int num1=34;
int num2=32;
int sum =method(num1,num2);
double num3 =33.33;
double num4 =44.44;
double sub=suha(num3,num4);
System.out.println("Addition is:"+sum);
System.out.println("Subtraction is:"+sub);
}
}
/*
OUTPUT
PS C:\Users\tanma\OneDrive\Desktop\my java program> cd "c:\Users\tanma\OneDrive\Desktop\my java program\" ; if ($?) { javac Methodover.java } ; if ($?) { java Methodover }
Addition is:66
Subtraction is:-11.11
*/