Skip to content

Instantly share code, notes, and snippets.

@girish3
Last active March 25, 2018 17:50
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save girish3/4aa61991505f9e8f7688fb6f6870f232 to your computer and use it in GitHub Desktop.
golang oop 2 article snippet
// the example is in Java
class Base {
private int i = 0;
void inc1() {
inc2(); // the change
}
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