439 training reviews
20 years in business
Call us on: 01457 858 877
Visual C# 2010 (also sometimes called C# 4.0) allows optional and named arguments (hooray!). See also our list of Visual Studio 2010 changes and what's new in ASP.NET 4.0.
Specific new or changed features in Visual C# 2010 include:
You can now pass arguments to a method in C# by name as well as position (VB programmers will be wondering why it took so long). In the following example, the shaded text wouldn't have worked in earlier versions of C#:
You can now use optional arguments (again, VB programmers will be scratching their heads at how it took so long). In the example below, the argument height is assigned a default value of 2, so it can be omitted from a call to the CalculateBMI method:
The new call hierarchy window allows you to see calls to and from a selected method, property, or constructor:
You can view a full list of changes in recent versions of Visual C# by returning to our main Visual C# version history page.