-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTest.java
52 lines (52 loc) · 942 Bytes
/
Test.java
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
52
public class Test {
static void a(int z, int y, int x, Integer w) {
int a;
a = 0;
int b;
b = 1;
int c;
c = a + b;
}
void b(int a)
{
if(a == 99)
{
System.out.println("a is 99");
}
else
{
System.out.println("a is not 99");
}
}
public String toString() {
return "Hi! I'm a Test object.";
}
public int polyMorphic1() {
return 1;
}
public int polyMorphic2(int x) {
return x + 10;
}
public int polyMorphic3(String x) {
return Integer.parseInt(x);
}
public int polyMorphic4(int x, Test y) {
return 4;
}
public int polyMorphic5(int x, Object y) {
return 5;
}
private int x = 0;
public Test() {
System.out.println("WELL the constructor was called!");
x = 150;
}
public static void main(String args[]) {
System.out.println("Jess");
a(32, 22, 12, 2);
int x[] = {1,2,3};
System.out.println("x= " + x);
Test t = new Test();
t.b(400);
}
}