Microsoft will introduce a new syntax in C # 6 that will allow you to set a read-only property, as shown below:
public class Animal { public string MostDangerous { get; } = "Mosquito"; }
I am wondering what the added value of this approach is.
What is the difference just by writing:
public class Animal { public const string MostDangerous = "Mosquito"; }
or even:
public class Animal { public string MostDangerous { get { return "Mosquito"; } } }
source share