Wriju's BLOG

.NET, Cloud and everything

VB.NET 10 : Nullable Optional Parameter

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!!!