Lecture overview -- Keyboard shortcut: 'u'  Previous page: Properties: Class Point with polar coordinates -- Keyboard shortcut: 'p'  Next page: Object Initialization via Properties -- 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 9 : 29
Object-oriented Programming in C#
Data Access, Properties, and Methods
Automatic Properties

In C# 3.0 it is possible to automatize the definition of trivial getter and setter properties

/user/normark/oop-csharp-1/sources/c-sharp/csharp-3/automatic-properties/BankAccount.csClass BankAccount with two automatic properties.


/user/normark/oop-csharp-1/sources/c-sharp/csharp-3/automatic-properties/BankAccount-equivalent.csAn equivalent BankAccount class without automatic properties.


/user/normark/oop-csharp-1/sources/c-sharp/csharp-3/automatic-properties/Client.csA Client of class BankAccount.


/user/normark/oop-csharp-1/sources/c-sharp/csharp-3/automatic-properties/outputOutput from the Client program.


Automatic properties contribute to a C# 3.0 convenience layer on top of already existing means of expressions.