Interviews3 answers
What is the difference between C# 3.5 and C# 4.0?
3 Answers
1) C# 4.0 supports dynamic programming through dynamic objects.C# 3.5 does not support dynamic programming.
2) 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.
3) C# 4.0 allows creation of dynamic variables. Dynamic variables cannot be created in C# 3.5.
4) 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.
5) 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.
6) 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.
ShrabanPosted Feb 3, 2016, 10:16 PM EST
the main difference is that Named parameters, dynamic keywords, Object indexed properties, Co-variance and Contravariance were introduced in 4.0, which were not in 3.5.
VIVEK KAUSHIKPosted Apr 22, 2015, 6:59 PM EDT
http://dotnetguts.blogspot.in/2010/06/difference-between-net-40-and-net-35-20.html
Rakesh ShindePosted Apr 23, 2013, 2:07 AM EDT

