Monday 4 June 2012

Main Difference between C#3.0 vs c#4.0

C# 4.0
C# 3.5
C# 4.0 supports dynamic programming through dynamic objects.
C# 3.5 does not support dynamic programming.
In C# 4.0, dynamic keyword is associated with objects to represent them as dynamic objects.
The dynamic keyword is not recognized in C# 3.5.
C# 4.0 allows creation of dynamic variables.
Dynamic variables cannot be created in C# 3.5.
In C# 4.0, the method parameters can be specified with default values using optional parameters.
In C# 3.5, method parameters cannot be specified with default values. C# 3.5 does not support optional parameters.
C# 4.0 provides named parameters to represent the values of method parameters without following the order of declaration.
In C# 3.5, method parameters have to be specified in the same order as in method declaration in the method call. C# 3.5 does not provide named parameters.
In C# 4.0, usage of ref keyword is optional while executing methods which are supplied by the COM interfaces.
In C# 3.5, usage of ref keyword is mandatory while executing methods which are supplied by the COM interfaces.
The COM object’s indexed properties are recognized in C# 4.0.
The COM object’s indexed properties are not recognized in C# 3.5.
C# 4.0 enhances Generics by introducing co-variance and contra-variance.
Co-variance and contra-variance are not supported in Generics of C# 3.5.

No comments:

Post a Comment