CONTENTS
xvi
Initializing an Array......................................................................................................348
Explicit Initialization of One-Dimensional Arrays................................................................................348
Explicit Initialization of Rectangular Arrays........................................................................................349
Syntax Points for Initializing Rectangular Arrays................................................................................349
Shortcut Syntax ..................................................................................................................................350
Implicitly Typed Arrays .......................................................................................................................351
Putting It All Together.........................................................................................................................352
Jagged Arrays..............................................................................................................353
Declaring a Jagged Array ...................................................................................................................354
Shortcut Instantiation .........................................................................................................................354
Instantiating a Jagged Array ..............................................................................................................355
Subarrays in Jagged Arrays ...............................................................................................................356
Comparing Rectangular and Jagged Arrays ................................................................357
The foreach Statement ................................................................................................358
The Iteration Variable Is Read-Only ....................................................................................................360
The foreach Statement with Multidimensional Arrays .......................................................................361
Array Covariance .........................................................................................................363
Useful Inherited Array Members..................................................................................364
The Clone Method...............................................................................................................................366
Comparing Array Types ...............................................................................................368
Chapter 15: Delegates......................................................................................369
What Is a Delegate?.....................................................................................................370
Declaring the Delegate Type........................................................................................372
Creating the Delegate Object.......................................................................................373
Assigning Delegates ....................................................................................................375
Combining Delegates...................................................................................................376
Adding Methods to Delegates......................................................................................377
Removing Methods from a Delegate ...........................................................................378
Invoking a Delegate .....................................................................................................379