O'Reilly logo

C# Primer Plus by Klaus Michelsen

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

Array Elements Referencing Objects

The source program of Listing 10.13 shown later utilizes an array of elevators (line 35) to effectively control a collection of elevators. It is used to demonstrate the syntax and mechanics involved when array elements hold references to objects. Recall the elevator simulation example from Chapter 5. It defined an Elevator similar to that found in lines 3–29 of Listing 10.13, but only employed one of this kind. The Main() method (lines 33–54) in contrast manages 10 elevators.

To better focus on the important issues surrounding arrays of objects, the program has omitted some of the aspects included in the example of Chapter 5. There are, for example, no Person objects here; instead, the elevators are manipulated ...

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