The class Train represents trains which consist of a number of passenger cars. The cars are numbered from one upwards (starting from the head of the train).
A train object is mutable. New cars can be added to it with the addCar method, but initially a train has no cars. Trains have a maximum length (in cars) which they must not exceed.
A train may contain cars of various types, that is, instances of any class that extends TrainCar.
Parameters
description
a description of the train, e.g. "From Helsinki to Oulu, leaves at 8:13"