Properties

This lesson discusses properties, how to declare them, initialize them and use them in C#

Introduction

C# properties are class members that expose functionality of methods using the syntax of fields. They simplify the syntax of calling traditional get and set methods (a.k.a. accessor methods). Like methods, they can be static or instance.

Let’s take a look at public get and set accessors first.

Public Get

Getters are used to expose values from classes.

Get hands-on with 1400+ tech skills courses.