Skip to content

Instantly share code, notes, and snippets.

@pitosalas
Created February 3, 2012 16:41
Show Gist options
  • Save pitosalas/1731032 to your computer and use it in GitHub Desktop.
Save pitosalas/1731032 to your computer and use it in GitHub Desktop.
Stackoverflow question
abstract class EntityA {
AssocA myA;
abstract void meet();
}
abstract class AssocA {
int something;
abstract void greet();
}
class AssocAConcrete extends AssocA {
void greet() {
System.out.println("hello");
}
void salute() {
System.out.println("I am saluting.")
}
}
class EntityAConcrete extends EntityA {
void meet() {
System.out.println("I am about to meet someone");
((AssocAConcrete)myA).salute();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment