Skip to content

Instantly share code, notes, and snippets.

@geakstr
Created November 15, 2015 16:02
Show Gist options
  • Save geakstr/b26c8eabb019b34fce79 to your computer and use it in GitHub Desktop.
Save geakstr/b26c8eabb019b34fce79 to your computer and use it in GitHub Desktop.
public class HelloWorld {
static class A {
public A() {
System.out.println("A");
}
}
static class B extends A {}
public static void main (String[] args) {
B b = new B(); // output: A
}
}
public class HelloWorld {
static class A {
public A() {
System.out.println("A");
}
}
static class B extends A {
public B() {
System.out.println("B");
}
}
public static void main (String[] args) {
B b = new B(); // output: A\nB
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment