Fields and properties are global, that is, you can use them anywhere in this class, unlike declaring a variable in one method, but you can't use it directly in another method.
First tell the landlord the fields and attributes. Simply put, attributes are public and fields are private. In other words, when you instantiate the object of this class, you can get the properties directly, but you can't get the fields. Property is used to modify fields. Maybe the landlord thinks it's strange here Why not expose the field directly? Do you have to bypass an attribute? This is used to prevent the value of the field from not meeting the requirements. For example.
Student class, age (integer), is it unreasonable to assign the age to-1? Therefore, adding an attribute to control and assigning it-1 found it unreasonable, so the attribute assigned a default value (such as 0) to the field.
But in practice, you don't have to do it completely. You can control the input range (such as the code of the interface) in the code, so that the fields can be directly exposed.
Back to what the landlord said, are all data members fields? Because data members belong to fields, data of value type and data members of reference type naturally belong to fields. Value type and reference type are only data types of this field.