Woodie,
That is the "Whyte system" of classification. The first number in the group refers to the number of wheels in the pilot truck (if any), the last number is the number of wheels in the trailing truck. The numbers inbetween are the "drive" wheels. Therefore, 2-8-0 means 2 pilot wheels, 8 drive wheels and no trailing truck. A 4-8-8-4 has 4 pilot, two separate sets of 8 drive wheels, and 4 trailing truck wheels. (That's the configuration of the Union Pacific "Big Boys," which were articulated steam locos.)
The Whyte system counts the number of wheels. Other systems refer to the number of axles. For example, a 4-6-2 (Pacific) can be referred to as a 2-3-1 (or 231). The Whyte system is the standard in the U.S.
It is usually redundant to state both the Whyte classification and the class name of a locomotive (i.e., "2-8-0 Consolidation"), but the name often clarifies the particular variant of the wheel arrangement. The "name" is usually derived from the name of the railroad(s) that used them. "Consolidation" came from the Lehigh Valley RR, which had been created from the merger of several smaller railroads and was the first to use the 2-8-0 design. That name stuck for all 2-8-0s. 2-10-4s, on the other hand, are referred to as Texas (Texas & Pacific), Colorado (Chicago, Burlington & Quincy) and Selkirk (Canadian Pacific).
A similar system is used for diesel and electrical locomotives. The system is different because not all wheels on a truck are necessarily powered. The system uses a combination of letters and numbers--the letters represent the number of axles on the truck (A=1, B=2, C=3, etc.), and the numbers are the number of unpowered axles. So, a B0-B0 has two trucks, each with two axles, and all axles are powered (this would be pronounced "bo bo"). A B0-C0 has two trucks, one with two axles and the other with three, all powered. If no numbers appear by the letters, then "0" is implied. The classic GG1 electric locomotive was classified 2-C-C-2: 2 unpowered axles on one truck, two trucks with three axles each (all powered), and another 2 axle unpowered truck.
For more information, check out
www.steamlocomotive.com and click on the section on "Classification Definitions." An interesting note: the guy who runs this site recently moved to Australia!
Humans love to classify things!
-Rory