Skip to content

Instantly share code, notes, and snippets.

@ufocoder
Created November 6, 2018 09:40
Show Gist options
  • Select an option

  • Save ufocoder/adfaf5f4587659cb6ccaf53f4892f906 to your computer and use it in GitHub Desktop.

Select an option

Save ufocoder/adfaf5f4587659cb6ccaf53f4892f906 to your computer and use it in GitHub Desktop.
interface InjectWheels {
 public void setWheels(Wheels w);
}
interface InjectBattery {
 public void setBattery(Battery b);
}
class Car implements InjectWheels, InjectBattery {
 Wheels injectedWheels; 
 Battery injectedBattery;
public void setWheels(Wheels w) {
  this.injectedWheels = w;
 }
public void setBattery(Battery b) {
  this.injectedBattery = b;
 }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment