Basis for review

Source: Internet
Author: User

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

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.