using System; class Example { public Example(int property) { Property = property; } public int Property { get; private set; } } class Program { static void Main() { Example example = new Example(5); Console.WriteLine(example.Property); } } http://www.dotnetperls.com/class