16 lines
No EOL
240 B
Text
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;
|
|
}
|
|
} |