- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMethodTest.java
More file actions
Latest commit
33 lines (21 loc) · 711 Bytes
/
Copy pathMethodTest.java
File metadata and controls
33 lines (21 loc) · 711 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
publicclassMethodTest {
staticintx = 10;
publicstaticvoidmain(String[] args) {
intx = 75;
System.out.printf("My subtraction result is %s\n", (x - 50));
multiply();
add(10, 23);
divide(225, x);
}
publicstaticvoidmultiply() {
intx = 5;
inty = x * x * x;
System.out.printf("My multiplication result is %s\n", y);
}
publicstaticvoidadd(intnumber1, intnumber2) {
System.out.printf("My addition result is %s\n", (number1 + number2 + x));
}
publicstaticvoiddivide(intnumber1, intnumber2) {
System.out.printf("My division result is %s\n", (number1 / number2));
}
}