| <<< Object-oriented Software System | Index | Stack Class Java Example >>> |
public class Account
{
private float balance; // property
public float withdraw( float amount ) // operation
{
if ( amount >= balance ) {
balance = balance - amount;
return amount;
} else {
return 0.0;
}
}//withdraw
}//class Account
| <<< Object-oriented Software System | Index | Stack Class Java Example >>> |