Class composition: public operations and properties; non-public implementation details.
Class Design: 1. Determine the set of operations that can be executed by the class. These operations will become member functions of the class.
2. Determine the interface (return type, parameter column) of each member function ).
3. determine the access level of each function.
static data members only have one unique entity in the entire Program . The syntax for accessing static members in the class member function is exactly the same as that for accessing instance members. In addition to the class ontology, we can directly access the object by using the Class Name of the static member. Note: Therefore, you cannot access static members using an object of the class.
at most one static constructor can be defined for each class, and access-level keywords cannot be added. The parameter column must be blank.
in order not to violate the encoding rules, static data members are usually declared as private, and read/write access is provided through statci property.
definition: The const keyword is used to modify the declaration of a field or local variable. The value of the specified field or local variable cannot be modified. Constant declaration introduces one or more constants of a given type.
the const data member declaration must contain the initial value, and the initial value must be a constant expression. Because it needs to be fully evaluated during compilation.
a const member can be initialized using another const member, provided that there is no circular dependency between the two.
readonly evaluates and assigns values at runtime, so that we can postpone object initialization until runtime while ensuring "read-only access.
the readonly keyword is different from the const keyword. The const field can only be initialized in the declaration of this field. The readonly field can be initialized in the Declaration or constructor. Therefore, the readonly field may have different values based on the constructors used. In addition, the const field is the number of compiling times, while the readonly field can be used for running times.