using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Text.RegularExpressions; namespace forgetCode { class Program { static void Main(string[] args) { Example example = new Example(); example.Number = 100; // set { } Console.WriteLine(example.Number); // get { } } class Example { int _number; public int Number { get { return this._number; } set { this._number = value; } } } } }
Output: 100