Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@ajduke
Created August 20, 2012 10:00
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/3402777 to your computer and use it in GitHub Desktop.
Save ajduke/3402777 to your computer and use it in GitHub Desktop.
public class SuperClass {
int i = 1;
}
public class SubClasss extends SuperClass {
int i = 2;
public void display() {
System.out.println(i); // result 2
System.out.println(super.i); // result 1
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment