Lecture overview -- Keyboard shortcut: 'u'  Previous page: Automatic Properties -- Keyboard shortcut: 'p'  Next page: Summary of properties in C#  -- 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 10 : 29

Object Initialization via Properties
In C# 3.0 properties can be used together with constructors to ease creation of new objects.
BankAccount.cs
Class BankAccount - as short as possible.
Client.cs
A client of the simple BankAccount with object initializers.
ClientEquivalent.cs
An equivalent BankAccount class without object initializers.
BankAccount.cs
Class BankAccount - with two constructors.
Client.cs
A client of class BankAccount with an object initializer.
Client-equivalent.cs
An equivalent client of class BankAccount without object initializers.
output
Output of the Client program.
BankAccount.cs
Class BankAccount and class Person.
Client.cs
A client of class BankAccount with nested object initializers.
The use of object initializers mimics the use of keyword parameters in constructors