20 lines
277 B
Text
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);
|
|
}
|
|
}
|