10. Classes and Objects: A Deeper Look

Objectives

In this chapter you’ll learn:

• Encapsulation and data hiding.

• The concepts of data abstraction and abstract data types (ADTs).

• To use keyword this.

• To use indexers to access members of a class.

• To use static variables and methods.

• To use readonly fields.

• To take advantage of C#’s memory-management features.

• How to create a class library.

• When to use the internal access modifier.

• To use object initializers to set property values as you create a new object.

• To add functionality to existing classes with extension methods.

• To use delegates and lambda expressions to pass methods to other methods for execution at a later time.

• To create objects of anonymous types.

Instead ...

Get C# 2010 for Programmers, Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.