Skip to content

Instantly share code, notes, and snippets.

@girish3
Created May 29, 2017 14:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save girish3/4e8a26a643210b77c159a1149fc6c967 to your computer and use it in GitHub Desktop.
Save girish3/4e8a26a643210b77c159a1149fc6c967 to your computer and use it in GitHub Desktop.
// the example is in Java
class Base {
private int i = 0;
void inc1() {
i++;
}
void inc2() {
i++;
}
}
class Child extends Base {
@Override
void inc2() {
inc1();
}
}
Child child = new Child();
child.inc2();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment