compiler-design-eth/javali_tests/HW4/OkCallWithParamField.javali

21 lines
277 B
Text
Raw Normal View History

2020-01-15 22:34:57 +01:00
/* Test access to parameters and fields */
class A {
int i;
void foo(int p) {
write(p);
write(i);
writeln();
}
}
class Main {
void main() {
A a;
a = new A();
a.i = 10;
a.foo(1);
a.foo(2);
a.foo(3);
}
}