need some help here with the Date type.
I'm managing a CreditCard class with the following parameters
public class CreditCard extends Card{
Date monthlyFee;
double amount2pay;
public CreditCard(StandardAccount yourAssociatedBankAccount,Date monthlyFeeDay) {
super(yourAssociatedBankAccount);
monthlyFee=monthlyFeeDay;
cardType="Credit Card";
}
when the CreditCard is created, I have to set the MonthlyFeeDay (which is for instance "today + 30 days").
The following function has to create the CreditCard
public void createCreditCard(StandardAccount anAccount){
Date today= new Date();
Card newCard= new CreditCard(anAccount,today);
anAccount.addCard(newCard);
cardsList.add(newCard);
}
The fact is, I don't know how to increment the variable "today" by 30 days. I don't know how to set the day of the next month. Any hint?