forked from AndrewProgramming/JavaTutorialCode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMethodDemoA.java
More file actions
38 lines (28 loc) · 796 Bytes
/
MethodDemoA.java
File metadata and controls
38 lines (28 loc) · 796 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
package methodDemo;
public class MethodDemoA {
public static int returnTwoIntMax(int num1, int num2) {
if (num1 < num2) {
return num2;
} else {
return num1;
}
}
private int min(int num1, int num2) {
if (num1 < num2) {
return num1;
} else {
return num2;
}
}
protected void helloMethod(String message) {
System.out.println(message);
}
public static void main(String arg[]) {
int r1 = MethodDemoA.returnTwoIntMax(2, 3);
System.out.println("r1=" + r1);
MethodDemoA methodDemoA = new MethodDemoA();
methodDemoA.helloMethod("Hi Method");
int r2 = methodDemoA.min(45, 99);
System.out.println("r2=" + r2);
}
}