Skip to content

Instantly share code, notes, and snippets.

@elben
Created May 5, 2010 04:26
Show Gist options
  • Save elben/390380 to your computer and use it in GitHub Desktop.
Save elben/390380 to your computer and use it in GitHub Desktop.
class A {
public void publ() {
this.priv();
}
private void priv() {
System.out.println("A PRIVATE");
}
}
class B extends A {
private void priv() {
System.out.println("B PRIVATE");
}
}
public class Test {
public static void main(String args[]) {
B b = new B();
b.publ();
A a = new B();
a.publ();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment