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 and notes together  slide -- Keyboard shortcut: 't'  Textbook -- Keyboard shortcut: 'v'  Help page about these notes  Alphabetic index  Course home  Page 10 : 29
Object-oriented Programming in C#
Data Access, Properties, and Methods
Object Initialization via Properties

In C# 3.0 properties can be used together with constructors to ease creation of new objects.

/user/normark/oop-csharp-1/sources/c-sharp/csharp-3/object-initialization-simple-1/BankAccount.csClass BankAccount - as short as possible. This program is explained


/user/normark/oop-csharp-1/sources/c-sharp/csharp-3/object-initialization-simple-1/Client.csA client of the simple BankAccount with object initializers.


/user/normark/oop-csharp-1/sources/c-sharp/csharp-3/object-initialization-simple-1/ClientEquivalent.csAn equivalent BankAccount class without object initializers.


/user/normark/oop-csharp-1/sources/c-sharp/csharp-3/object-initialization/BankAccount.csClass BankAccount - with two constructors. This program is explained


/user/normark/oop-csharp-1/sources/c-sharp/csharp-3/object-initialization/Client.csA client of class BankAccount with an object initializer. This program is explained


/user/normark/oop-csharp-1/sources/c-sharp/csharp-3/object-initialization/Client-equivalent.csAn equivalent client of class BankAccount without object initializers. This program is explained


/user/normark/oop-csharp-1/sources/c-sharp/csharp-3/object-initialization/outputOutput of the Client program.


/user/normark/oop-csharp-1/sources/c-sharp/csharp-3/nested-object-initialization/BankAccount.csClass BankAccount and class Person. This program is explained


/user/normark/oop-csharp-1/sources/c-sharp/csharp-3/nested-object-initialization/Client.csA client of class BankAccount with nested object initializers. This program is explained


The use of object initializers mimics the use of keyword parameters in constructors