Read-only Properties
You can also create read-only properties if you omit the set accessor method. For example, to make the Name property a read-only property, you use this code:
class Customer { private string name; public string Name { get { return name; } } }
Get Microsoft® Visual C#® .NET 2003 Kick Start 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.