constructor - Using if/else statements in setters -
in uml telling me not let field update if value negative
public void setcurrentbalance(double currentbalance) { if (currentbalance <= 0) this.currentbalance = currentbalance; else this.currentbalance = currentbalance; }
does correct if constructor looks like:
setaccountnumber(accountnumber); setownerfirstname(ownerfirstname); setownerlastname(ownerlastname); setcurrentbalance(currentbalance); setminimumbalancerequired(minimumbalancerequired);
Comments
Post a Comment