previous | start

Explicit and Implicit Parameters

public void withdraw(double amount)
{
double newBalance = balance - amount;
balance = newBalance;
}
balance is the balance of the object to the left of the dot:

momsSavings.withdraw(500)
means
   double newBalance = momsSavings.balance - amount;
momsSavings.balance = newBalance;


previous | start