30 lines
357 B
Text
30 lines
357 B
Text
// Access inherited and hidden fields (general check)
|
|
|
|
class Other {
|
|
int a;
|
|
int b;
|
|
Object c;
|
|
Other o;
|
|
}
|
|
|
|
class Main extends Other {
|
|
int a, b;
|
|
|
|
void main() {
|
|
Other o;
|
|
o = (Other) this;
|
|
a = 1;
|
|
b = 2;
|
|
o.a = -1;
|
|
o.b = -2;
|
|
write(a);
|
|
write(b);
|
|
write(o.a);
|
|
write(o.b);
|
|
if (c != null) {
|
|
if (o.o != null) {
|
|
write(0);
|
|
}
|
|
}
|
|
}
|
|
}
|