// Collection of code snippets by Arne Vajhøj // (from articles on eksperten.dk / vajhoej.dk written sometime between 2004 and now) using System; public class C { public int Iv { get; set; } = 0; public double Xv { get; set; } = 0.0; public string Sv { get; set; } = ""; public override string ToString() { return string.Format("({0},{1},{2})", Iv, Xv, Sv); } } public class PCtor11X { public static void Main(string[] args) { Console.WriteLine(new C { Iv = 123, Xv = 123.456, Sv = "ABC" }); Console.WriteLine(new C()); } }