-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmath.java
More file actions
51 lines (38 loc) · 856 Bytes
/
math.java
File metadata and controls
51 lines (38 loc) · 856 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
41
42
43
44
45
46
47
48
49
50
51
public class math {
public static void main(String[] args) {
plus pls = new plus(40, 50,60);
pls.show();
minus min = new minus(20,40);
min.show();
}
}
class plus{
private int Value=0;
plus(int n1, int n2){
Value = n1+n2;
}
plus(int n1, int n2, int n3){
Value=n1+n2+n3;
}
plus(int n1, int n2, int n3, int n4){
Value=n1+n2+n3+n4;
}
void show(){
System.out.println(Value+"입니다.");
}
}
class minus{
private int Value=0;
minus(int n1,int n2){
Value=n1-n2;
}
minus(int n1,int n2,int n3){
Value=n1-n2-n3;
}
minus(int n1, int n2, int n3, int n4){
Value=n1-n2-n3-n4;
}
void show(){
System.out.println(Value+"입니다.");
}
}