O'Reilly logo

Applied Microsoft® .NET Framework Programming by Jeffrey Richter

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

Chapter 14. Arrays

Arrays are mechanisms that allow you to treat several items as a single collection. The Microsoft .NET common language runtime (CLR) supports single-dimension arrays, multidimension arrays, and jagged arrays (that is, arrays of arrays). All array types are implicitly derived from System.Array, which itself is derived from System.Object. This means that arrays are always reference types that are allocated on the managed heap and that your application’s variable contains a reference to the array and not the array itself. The following code makes this clearer:

Int32[] myIntegers;          // Declares a reference to an array
myIntegers = new Int32[100]; // Creates an array of 100 Int32s

On the first line, myIntegers is a variable that’s capable ...

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