-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathMethodCalls2.java
More file actions
43 lines (35 loc) · 837 Bytes
/
MethodCalls2.java
File metadata and controls
43 lines (35 loc) · 837 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
class MethodCalls2 {
public static void main(String [] a) {
Test1 t;
t = new Test1();
System.out.println(t.getFieldA());
System.out.println(t.getFieldB());
System.out.println(t.foo());
System.out.println(t.bar(5));
System.out.println(t.buz());
System.out.println(t.getFieldA());
System.out.println(t.getFieldB());
Prover.answer(0);
}
}
class Test1 {
int fielda;
int fieldb;
public int foo() {
return 5;
}
public boolean bar(int x) {
fieldb = 30;
return (x > 2);
}
public int buz() {
fielda = 20;
return 3;
}
public int getFieldA() {
return fielda;
}
public int getFieldB() {
return fieldb;
}
}