| An equivalent BankAccount class without automatic properties. | Lecture 5 - slide 9 : 29 Program 2 |
using System;
public class BankAccount{
private string _owner;
private decimal _balance;
public BankAccount(string owner, decimal balance){
_owner = owner;
_balance = balance;
}
public string Owner {
get {return _owner;}
set {_owner = value;}
}
public decimal Balance {
get {return _balance;}
set {_balance = value;}
}
public override string ToString(){
return Owner + "'s account holds " + Balance + " kroner";
}
} |