// Collection of code snippets by Arne Vajhøj // (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) using System; namespace E { public class Fruit { private int _value; private string _color; public int Value { get { return _value; } } public string Color { get { return _color; } } private Fruit(int val, string col) { _value = val; _color = col; } public static Fruit Apple = new Fruit(1, "Red"); public static Fruit Kiwi = new Fruit(2, "Green"); public static Fruit Pear = new Fruit(3, "Yellow"); } public class Program { public static void Main(string[] args) { Console.WriteLine(Fruit.Apple.Color); } } }