Skip to content

Instantly share code, notes, and snippets.

@PatilShreyas
Created March 14, 2020 18:12
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 PatilShreyas/8c3e8375c9483ac2363b3acc4b1ecfba to your computer and use it in GitHub Desktop.
Save PatilShreyas/8c3e8375c9483ac2363b3acc4b1ecfba to your computer and use it in GitHub Desktop.
public class Clothes {
public Money mMoney;
@Inject
public Clothes(Money money) {
this.mMoney = money;
if (mMoney != null) {
System.out.println("I've Clothes to wear!");
} else {
System.out.println("I don't have enough clothes to wear!");
}
}
}
public class Food {
public Money mMoney;
@Inject
public Food(Money money) {
this.mMoney = money;
if (mMoney != null) {
System.out.println("I can eat delicious dishes!");
} else {
System.out.println("I even can't eat meal two times a day!");
}
}
}
public class Shelter {
public Money mMoney;
@Inject
public Shelter(Money money) {
this.mMoney = money;
if (mMoney != null) {
System.out.println("I've my own house to live!");
} else {
System.out.println("I don't have my own house yet!");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment