Skip to content

Instantly share code, notes, and snippets.

@whaley
Created January 29, 2018 17:34
Show Gist options
  • Save whaley/e38e5efc0ff98a2b5c727eacadf8de2f to your computer and use it in GitHub Desktop.
Save whaley/e38e5efc0ff98a2b5c727eacadf8de2f to your computer and use it in GitHub Desktop.
public abstract class Foo {
private Foo() {}
public abstract void overrideMePlease();
public static class Bar extends Foo {
@Override
public void overrideMePlease() {
System.out.print("overriden in " + this.getClass().getSimpleName());
}
}
public static class Baz extends Foo {
@Override
public void overrideMePlease() {
System.out.print("also overriden in " + this.getClass().getSimpleName());
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment