Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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