O'Reilly logo

Visual Basic 2010 Unleashed by Alessandro Del Sole

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Working with Arrays

As a developer you of course know what arrays are. They are basically a place in which you can store a set of items, generally of the same type. In the .NET Framework 4.0 (as in older versions), arrays are reference types all deriving from the System.Array class and can be both one-dimensional and multidimensional.

Arrays Versus Collections

Collections, especially generic ones, are generally more efficient than arrays. I always recommend working with collections instead of arrays, except when strictly needed. (For example, you might need jagged arrays.)

You can either declare an array and use it later in your code or declare it and assign it with objects. The following is an example of declaring an array of String objects, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required