Article: http://blog.csdn.net/scauscnu/article/details/13621137 This has to say { get; set; }, because there is no private self-segment, we cannot manually specify the default value, so what is the default value of the system?
For int types, the default value is 0; For int? type, the default value is null; For bool types, the default value is false; For bool? type, the default value is null; For the String type, the default value is null; For string? Type, haha, without this way of writing, there will be mistakes; For the DateTime type, the default value is 0001-01-01 00:00:00; For DateTime? type, the default value is null; For enum types, the default value is an item with a value of 0, if an enum item with 0 does not exist, it is still 0, see C# Enums; For enums? type, the default value is null; For class types, the default is an uninstantiated object reference; For class? Type, haha, without this way of writing, there will be mistakes. Regarding the type plus ?, it means that the value of this type can be null, for example, int originally has no null value, plus int? It can be null.
We directly imitate and write,
Exception is thrown: Process is terminated due to StackOverflowException.
This kind of article is really misleading if you don't practice it yourself!!
|