Home Segments Index Top Previous Next

447: Mainline

At first, you might think you could define some sort of an array to hold a train full of engine, box-car, tank-car, and caboose objects. You cannot, however, because the objects stored in any one array must be of the same type. You could have an array of engines, another array of box cars, another of tank cars, and still another of cabooses, but you cannot have an array with some of each.