If any one can help me please to answer this questions please:
What is the difference between this.dollars and otherMoney.getDollars()
2.- What the return statement of this method is returning.
3.- How this method would be called from the main and give an example
Thank you in advanced.// instance methods
public Money addMoney( Money otherMoney ) {
int newd = dollars + otherMoney.getDollars();
int newc = cents + otherMoney.getCents();return new Money( newd, newc );
}
public Money subtractMoney( Money otherMoney ) {
int newd = dollars - otherMoney.getDollars();
int newc = cents - otherMoney.getCents();return new Money( newd, newc );
}