Basis for review
1. Automatic attributes are short for attributes. However, during background compilation, the attribute code is automatically supplemented.
2. Variable type
Var:
In fact, it is not a real variable, but a strongly typed object that can be inferred can help us identify it automatically. A type that is too complex to be declared can be used. Or, if the number of times is small
Determine the type during Var Compilation
Dynamic:
The real variable type. In the runtime stage, you can view the value you have given it to assign the type, which is variable at runtime and weak.
Determine the Dynamic runtime type
3. Object initializing and set initializing: it is actually a syntactic sugar.
Object initializer Syntax: the object must have a construction method without parameters. If there are parameters, add parameters in brackets. Generally, there must be a construction method without parameters.
Set initializer Syntax:
4. Anonymous objects,
Generally, you only need to use a class once. In essence, it is also a type.
4. Expansion Method
1. Static class
2. Static Method
3. This keyword
4. Syntax:
5. Delegate, anonymous method and Lambda expression
Statement:
Declare delegate variables:
Standard use:
Anonymous method:
Lambda statement: can be run independently
Lambda expressions: cannot run independently