Let's say I have a Money class that looks like this:
public class Money {
private BigDecimal amount;
private Currency currency;
}
I'd like to add two of these classes together, e.g.
Money m1 = Money(5);
Money m2 = Money(10);
Money m3 = m1+m2; // m3.amount should be 15
How would I write a method so that I could add together two of these Money classes?