O'Reilly logo

Applied Microsoft® .NET Framework Programming by Jeffrey Richter

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 10. Properties

In this chapter, I’ll talk about properties. Properties allow source code to call a method using a simplified syntax. The common language runtime (CLR) offers two kinds of properties: parameterless properties, which are called properties, and parameterful properties, which are called different names by different programming languages. For example, C# calls parameterful properties indexers, and Visual Basic calls them default properties.

Parameterless Properties

Many types define state information that can be retrieved or altered. Frequently, this state information is implemented as field members of the type. For example, here’s a type definition that contains two fields:

public class Employee { public String Name; // The employee's ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required