compiler-design-eth/javali_tests/HW4/OkCallWithParamField.javali
Carlos Galindo 72cc3206c4
Homework 4
2020-01-15 22:34:57 +01:00

20 lines
277 B
Text

/* 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);
}
}