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

16 lines
No EOL
240 B
Text

// Hide a field from a superclass (type doesn't need to match)
class Parent {
int a;
}
class Main extends Parent {
Object a;
Main b;
void main() {
Parent c;
b = new Main();
b.a = new Object();
c = new Parent();
c.a = 10;
}
}