Skip to content

Instantly share code, notes, and snippets.

@shixiaoyu
Last active August 29, 2015 14:05
Show Gist options
  • Save shixiaoyu/41e69a377325a11dda96 to your computer and use it in GitHub Desktop.
Save shixiaoyu/41e69a377325a11dda96 to your computer and use it in GitHub Desktop.
public class TestClass {
public TestClass() {
print();
public void print() {
System.out.println(this.getClass() + ": a:" + this.a + ", b:" + this.b);
public static void main(String[] args) {
TestClass test1 = new TestClass();
TestClass test2 = new TestClass2();
class TestClass2 extends TestClass {
public TestClass2() {
super();
print();
public void print() {
System.out.println(this.getClass() + ": a:" + this.a + ", b:" + this.b);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment