Encapsulation (computer programming): Difference between revisions

Content deleted Content added
Dexbot (talk | contribs)
m Bot: Cleaning up old interwiki links
changed php function name from "add" to "deposit"
Line 80:
* @return void
*/
public function adddeposit($money) {
$this->accountBalance += $money;
}
Line 111:
// We have clearly defined methods for adding and subtracting money from the Account
// If we didn't have a method for withdraw(), nothing would prevent us from withdrawing more money than was available in the account
$myAccount->adddeposit(10.24);
$myAccount->withdraw(4.45);