Skip to content

Glossary: C# Basics

Get-only and private set properties

Also written: { get; private set; }, { get; }, { get; set; }, private setter

Property forms that control who may change a value. `{ get; }` is set only in the constructor, `{ get; private set; }` only by the class's own code, and `{ get; set; }` anywhere.

Where the book teaches it

Related terms

Propertypublic, privateConstructor