在我的UML中它告诉我如果值为负
则不要让字段更新public void setCurrentBalance(double currentBalance)
{
if (currentBalance <= 0)
this.currentBalance = currentBalance;
else
this.currentBalance = currentBalance;
}
如果构造函数如下所示,这看起来是否正确:
setAccountNumber(accountNumber);
setOwnerFirstName(ownerFirstName);
setOwnerLastName(ownerLastName);
setCurrentBalance(currentBalance);
setMinimumBalanceRequired(minimumBalanceRequired);