Lecture overview -- Keyboard shortcut: 'u'  Previous page: Properties - Tricky Use -- Keyboard shortcut: 'p'  Next page: Properties: Class Point with polar coordinates -- Keyboard shortcut: 'n'  Lecture notes - all slides together  Annotated slide -- Keyboard shortcut: 't'  Textbook -- Keyboard shortcut: 'v'  Alphabetic index  Help page about these notes  Course home    Data Access, Properties, and Methods - slide 7 : 29

Properties in C#
Properties allow indirect getting and setting of instance variables
bank-account-1.cs
A BankAccount class with a trivial Balance property together with Deposit and Withdraw methods.
accumulating-bank-account.cs
A BankAccount class with a Balance property - without a balance instance variable.
accumulating-app.cs
A client program.
accumulating-output
Output from the client program.
disciplined-bank-account.cs
A BankAccount class with a disciplined Balance property.
disciplined-app.cs
A client of the disciplined BankAccount.
disciplined-output
Output of the this client.
Go to exercise
A funny BankAccount