bankaccount.cs

来自「csharp-solution,C#高效编程源码」· CS 代码 · 共 37 行

CS
37
字号

class BankAccount 
{
    public void Populate(decimal balance)
    {
        accNo = NextNumber();
        accBal = balance;
        accType = AccountType.Checking;
    }
    
    public long Number()
    {
        return accNo;
    }
    
    public decimal Balance()
    {
        return accBal;
    }
    
    public string Type()
    {
        return accType.Format();
    }
    
    private long accNo;
    private decimal accBal;
    private AccountType accType;
    
    private static long nextNumber = 123;

    private static long NextNumber()
    {
        return nextNumber++;
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?