Skip to content

Instantly share code, notes, and snippets.

@ajduke
Created August 20, 2012 10:14
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 ajduke/3402852 to your computer and use it in GitHub Desktop.
Save ajduke/3402852 to your computer and use it in GitHub Desktop.
public class SuperClass {
public void display() {
System.out.println("Super");
}
}
public class SubClasss extends SuperClass {
public void display() {
System.out.println("Sub");
}
private void access() {
display(); // invokes one in SubClass
super.display(); // invokes one in SuperClass
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment