Skip to content

Instantly share code, notes, and snippets.

@ifucolo
Created February 3, 2017 17:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ifucolo/0ab288ae871ed02b6ba28088f725babd to your computer and use it in GitHub Desktop.
Save ifucolo/0ab288ae871ed02b6ba28088f725babd to your computer and use it in GitHub Desktop.
interface IProgram {
public void work();
}
class Program implements IProgram{
public void work() {
// ....code
}
}
class SuperProgram implements IProgram{
public void work() {
//....code
}
}
class Engineer{
IProgram program;
public void setProgram(IProgram p) {
program = p;
}
public void manage() {
program.work();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment