Содержание
- 2. 27) public Nevermore60Customer(string Name) : this(Name, " ") 28) Таблица 4.1. Модификаторы видимости
- 3. 29) public class MyClass { // и т.д. 30) public class OuterClass { protected class InnerClass
- 4. Таблица 4.2. Другие модификаторы
- 5. 32) public interface IDisposable { void Dispose() ; } 33) class SomeClass: IDisposable { // Этот
- 6. 34) namespace Wrox.ProCSharp { public interface IBankAccount { void PayIn(decimal amount); bool Withdraw(decimal amount); decimal Balance
- 7. private decimal balance; public void Payln(decimal amount) { balance += amount; } public bool Withdraw(decimal amount)
- 8. public override string ToString() { return String.Format( "Сберегательный Банк Венеры: Баланс = (0,6:С}", balance); } }
- 9. 38) using System; using Wrox.ProCSharp; using Wrox.ProCSharp.VenusBank; using Wrox.ProCSharp.JupiterBank; 39) namespace Wrox.ProCSharp { class MainEntryPoint {
- 10. jupiterAccount.Withdraw(600); jupiterAccount.Withdraw(100); Console.WriteLine(jupiterAccount.ToString()); } } } 40) С:> BankAccounts Сберегательный Банк Венеры: Баланс = £100.00 Попытка
- 11. 43) Cannot implicitly convert type 'Wrox.ProCSharp.SomeOtherClass' to 'Wrox. ProCSharp.IBankAccount' Неявное преобразование типа 'Wrox.ProCSharp.SomeOtherClass' в 'Wrox.ProCSharp. IBankAccount'
- 12. 45) public class CurrentAccount: ITransferBankAccount { private decimal balance; public void Payln(decimal amount) { balance +=
- 13. public decimal Balance { get { return balance; } } public bool TransferTo(IBankAccount destination, decimal amount)
- 14. public override string ToString() { return String.Format( "Текущий счет в Банке Юпитера: Баланс = {0,6:С}", balance);
- 16. Скачать презентацию