Skip to content

Instantly share code, notes, and snippets.

@jsyeo
Created August 28, 2015 07:31
Show Gist options
  • Save jsyeo/28aede5abf13d82d6338 to your computer and use it in GitHub Desktop.
Save jsyeo/28aede5abf13d82d6338 to your computer and use it in GitHub Desktop.
Invoke Special Subclass Super Call
public class Main {
public static void main(String[] args) {
B b = new B();
b.foo();
}
}
class A {
void foo() {
}
}
class B extends A {
@Override
void foo() {
}
}
class C extends B {
@Override
void foo() {
super.foo();
}
}
class D extends B {
@Override
void foo() {
super.foo();
}
}
class E extends B {
@Override
void foo() {
}
}
class F extends A {
@Override
void foo() {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment