1,Generics: in my opinion, generics are achieved by parameterization of Data TypesCodeMore flexible reuse, the emergence of generic makesC #You can use the same piece of code to operate on multiple data types. Generic is undoubtedlyC #2.0The emergence of the most significant improvement givesC #Stronger type security, better reuse, higher efficiency and clearer constraints of code.
2,Anonymous method: the anonymous method allows us to directly associate code with the delegated instance, making the delegated instantiation more intuitive and convenient. In my opinion, this is justC #There is another syntax format. Instead of passing the method name to the delegated instance, there is another option.
3,Iterator: iterator allows us to write more convenientlyForeachStatement type. In my opinion, the appearance of the iterator is only an improvement.1.0InaccessibilityForeachRestrictions on the writing of statement types simplify some interfaces.
4,Local type: the local type allows us to write the code of a class in differentCSFile. The most typical application is to useVs2005CreateFormFile,VSThe generated code is automatically separated from the user code. The local type is passedPartialKeyword.
5,Null type: the null type is an image.Int? Can be empty. Essentially a generic applicationSystem. nullable <>.
6,Static class: a static class is only used to contain static members. It cannot be instantiated or inherited.
conclusion: these are some new features that I understand C #2.0 . Some features may be inaccurate. Of course, C #2.0 some other new features are not mentioned here, for example, different access restrictions for the Get and set accessors of the attribute and so on. C #3.0 is under development, C #3.0 introduces XML and / span> SQL two data processing technologies, let's look forward to it together.