VB.NET 10 : Array Literals

VB.NET 10 : Array Literals

  • Comments 0

VB.NET has another exiting feature which helps us to declare and initialize an array without explicitly specifying the type and dimension. This infers at compile time. Good for Lazy developer like me J

Dim arrInt = {1, 2, 3, 4, 5, 6, 7} 'becomes Integer()

 

Dim arrDouble = {1, 2, 3, 4, 5, 6, 7.9} 'becomes Double()

 

Dim arrString = {1, 2, 3, 4, 5, "Six"} 'becomes String()

 

Dim arrString2 = {"One", "Two", "Three"} 'becomes String()

 

Dim arr2D = {{1, 2, 3}, {4, 5, 6}} 'becomes Integer(,)

Namoskar!!!

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