\year does not just give a number; it gives an internal integer. This is one of the types of integers that TeX knows. Together with the denotation integers (these are just strings of digits, possibly converted between bases) they are known as the normal integers. Besides the normal integers there are also coerced integers, which occur when an internal glue or dimen is coerced to an integer.
TeX goes implicitly from a string of digits to a number, that is, if TeX expects a number then anything that looks like a number is accepted. So 42 is a number. The other way around has to be done explicitly though, either through \romannumeral or \number. When we are dealing with an internal integer, \the is equivalent to \number. Since you ask what you can use for XXXX when you want \theXXXX to print something, the answer is an internal integer. There are quite a lot, the ones that you can easily influence are tokens defined by chardef or mathdef and the contents of count registers.
For non-internal integers you want to use \number instead though. That is to say, \number123 will compile fine, where \the123 will fail.
\the\yearyields the year as a number (currently "2011"), while\yearmay be used directly in places where TeX expects a number. Perhaps you mean the fact that\yearis similar in effect to a TeX count register? – Joseph Wright Nov 21 '11 at 13:24