Skip to content

Instantly share code, notes, and snippets.

@PatilShreyas
Created March 14, 2020 17:42
Show Gist options
  • Save PatilShreyas/42a4281f433103ef2d2803b270fc6edd to your computer and use it in GitHub Desktop.
Save PatilShreyas/42a4281f433103ef2d2803b270fc6edd to your computer and use it in GitHub Desktop.
public class WithoutDI {
public static void main(String[] args) {
Education education = new Education();
Job job = new Job(education);
Money money = new Money(job);
Food food = new Food(money);
Clothes clothes = new Clothes(money);
Shelter shelter = new Shelter(money);
Needs needs = new Needs(food, clothes, shelter);
Life life = new Life(needs);
life.enjoy();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment