- 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
-
New Data types in SQL Server 2008 are : DATE - occupies 3 bytes . Has accuracy of 1 day . Data stored in 'YYYY-MM-DD' format TIME...
-
Question : State whether below class relationship is correct or not . If not why ? class A: B {} class B: C {} class C: A {} Answer...
-
How to pass null values to stored procedure from code behind ? Pass the parameter’s value as DBNull.Value from code-behind.
-
Different validation controls in ASP.NET are as follows : RequiredFieldValidator CompareValidator RangeValidator RegularExpressionValida...
-
Different types of primary behaviours are as follows : Service Behaviour Endpoint Behaviour Operation Behaviour Callback Behaviour
-
Cache object belongs to System.Web.Caching namespace.
-
Authentication is process of obtaining credentials such as username and password and validating the credentials. There are 3 types of ASP....
-
Custom HTTPmodule is created for: URL rewriting Compression Specialized authentication and authorization Specialized logging
-
Types of DML statements : Select Insert Update Delete
-
Question : You and a group of programmers have written a new web application using Visual Studio.NET for a new client. The application trac...
No comments:
Post a Comment