Skip to content

Instantly share code, notes, and snippets.

@ohcibi
Last active December 17, 2015 10:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ohcibi/5598772 to your computer and use it in GitHub Desktop.
Save ohcibi/5598772 to your computer and use it in GitHub Desktop.
public abstract Class A {
public B b;
public A(B b) {
this.b = b;
}
}
public abstract Class B {
}
public class ConcreteA extends A {
public ConcreteB b;
public ConcreteA(ConcreteB b) {
super(b);
}
}
public class ConcreteB extends B {
}
//....
ConcreteB b = new ConcreteB();
ConcreteA a = new ConcreteA(b);
//....
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment