// 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 A { private string s; public A() : this("") { } public A(string s) { this.s = s; } public string S { get { return s; } set { s = value; } } public override string ToString() { return s; } } public class B { private const string DEF_S = ""; private string s; public B() : this(DEF_S) { } public B(string s) { this.s = s; } public string S { get { return s; } set { s = value; } } public override string ToString() { return s; } } class MainClass { public static void Main(string[] args) { Console.WriteLine(new A()); Console.WriteLine(new A("*")); Console.WriteLine(new B()); Console.WriteLine(new B("*")); } } }