C# Default Parameters

前端 未结 4 1375
闹比i
闹比i 2020-12-30 08:32

This is, probably, a very simple answer for someone. I have a method with an Optional Parameter like so;

public static Email From(string emailA         


        
4条回答
  •  一个人的身影
    2020-12-30 09:26

    The language version is independent of the framework version. For C# they happen to run mostly in parallel, i.e. C# 4 and framework 4.0 came with Visual Studio 2010. (However there is no 3.5 version of C#.)

    With VB the version numbers are different, as VB 7 was the first VB.NET version. So, VB 10 comes at the same time as framework 4.0.

    The optional parameters is a language feature introduced in C# 4. When you use VS 2010 you use C# 4, even if you target framework 2.0, so you can use all C# 4 features.

提交回复
热议问题