Created
February 3, 2012 16:41
-
-
Save pitosalas/1731032 to your computer and use it in GitHub Desktop.
Stackoverflow question
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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