Welcome to MSDN Blogs Sign in | Join | Help

Wriju's BLOG

.NET and everything
VB.NET 10 : Array Literals

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

Posted: Wednesday, October 14, 2009 3:02 AM by wriju

Comments

No Comments

Leave a Comment

(required) 

(required) 

(optional)

(required) 

  
Enter Code Here: Required

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Page view tracker