Skip to content

Instantly share code, notes, and snippets.

@jsyeo
Created August 25, 2015 09:18
Show Gist options
  • Save jsyeo/4e1c0fd1c98ad371ba1a to your computer and use it in GitHub Desktop.
Save jsyeo/4e1c0fd1c98ad371ba1a to your computer and use it in GitHub Desktop.
Simple Class Hierarchy
public class Main {
public static void main(String[] args) {
A a = new C();
a.m();
}
}
class A {
void m() {
}
}
class B extends A {
void m() {
System.out.println("I am vulnerable");
}
}
class C extends A {
void m() {
System.out.println("I am harmless");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment