VB.NET 10 : Nullable Optional Parameter

VB.NET 10 : Nullable Optional Parameter

  • Comments 0

You can create method with optional parameter and also make them Nullable.

Optional with default value

Sub Test(ByVal _name As String, ByVal _email As String, Optional ByVal _age As Integer = 30)

 

Optional and Nullable

Sub Test(ByVal _name As String, ByVal _email As String, Optional ByVal _age As Integer? = Nothing)

Similarly you also may initialize the collection like Dictionary.

Namoskar!!!

Leave a Comment
  • Please add 7 and 4 and type the answer here:
  • Post