- Generics - The .NET Framework class library contains several new generic collection classes in the System.Collections.Generic namespace. These should be used whenever possible in place of classes such as ArrayList in the System.Collections namespace.
- Iterators - make it easier to dictate how a foreach loop will iterate over a collection's contents.The yield keyword is used to specify the value, or values, returned. When the yield return statement is reached, the current location is stored. Execution is restarted from this location the next time the iterator is called. You can use more than one yield statement in the same iterator
- Partial Classes - Partial type definitions allow a single type, such as a class, to be split into multiple files. The Visual Studio designer uses this feature to separate its generated code from user code.
- Nullable Types - Nullable types allow a variable to contain a value that is undefined. Nullable types are useful when working with databases and other data structures that may contain elements that contain no specific values.
- Anonymous Methods - It is now possible to pass a block of code as a parameter. Anywhere a delegate is expected, a code block can be used instead: there is no need to define a new method.
- Namespace alias qualifier - The namespace alias qualifier (::) provides more control over accessing namespace members. The global :: alias allows access the root namespace that may be hidden by an entity in your code.
- Static Classes - Static classes are a safe and convenient way of declaring a class containing static methods that cannot be instantiated. In C# version 1.2 you would have defined the class constructor as private to prevent the class being instantiated.
- External Assembly Alias - Reference different versions of the same component contained in the same assembly with this expanded use of the extern keyword.
- Property Accessor Accessibility - It is now possible to define different levels of accessibility for the get and set accessors on properties.
- Covariance and Contravariance in Delegates -The method passed to a delegate may now have greater flexibility in its return type and parameters.
Describe new features introduced with C# 2.0 ?
New features C# 2.0 are:
Subscribe to:
Post Comments (Atom)
Popular Posts
-
RegisterStartUpScript This adds the javascript code at the end of the page before the closing of form tag. RegisterClientScriptBlock Th...
-
delegate string Delegate1(object o); delegate object Delegate2(string s); static string Dispaly(object o) { r...
-
@@ERROR is a global variable used to return error number of last T-SQL.
-
Please follow below steps to enable transaction in Web Service : 1.Add a reference to System.EnterpriseServices.dll. 2.Add the System.Ente...
-
Authentication is process of obtaining credentials such as username and password and validating the credentials. There are 3 types of ASP....
-
window.open
-
To be in second normal form i.e 2NF , all information attributes or fields of the table are attributes of entity of table schema. All inform...
-
Replication is the way to keep data synchronised in multiple datbases. SQL Replication consists of two important part : Publisher - Datab...
-
The WebMethod attribute in Web Service provides the following properties: BufferResponse CacheDuration Description EnableSession Messa...
-
Computed Column is virtual column in table whose value is computed at runtime.The values are not stored in table but computed by the express...
No comments:
Post a Comment