- 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
-
Stored Procedure vs Function Stored procedure cannot be executed using SQL Select command whereas Function (UDF) can be executed using SQL ...
-
SSRS stands for SQL Server Reporting Services . SSRS is server based reporting platform. It provides reporting functionality from different ...
-
Criteria BasicHttpBinding WsHttpBinding Security support This supports the old ASMX style, i.e. WS-BasicProfile 1.1. This exposes web ser...
-
Database Connection - Datereader requires an open database connection whereas Dataset does not require an open database connection Namespa...
-
Covariance permits a method to have a more derived return type than what is defined in the delegate. Contravariance permits a method with...
-
IIS provides a variety of authentication schemes: • Anonymous (enabled by default) - Client does not provide any credetials • Basic - ...
-
Different types of diagrams in UML : UseCase diagram Class diagram Object diagram State diagram Sequence diagram Collaboration diagram...
-
Extents are basic unit in which space is allocated to tables and indexes. Extent is eight contiguous pages i.e 64 KB.
-
Normalization is a method to seperate data into multiple tables and relate these multiple tables. Some benefits of normalized database : 1)...
-
Difference between Control Flow and Data Flow in SSIS are as follows : The smallest unit in Control Flow is task whereas smallest unit in D...
No comments:
Post a Comment