The output is "1", not "1 1 1". The single println() in main() prints the value of Z.x because the compiler figures out what variable to access during compilation based on the compile-time type of the variable "z". There's no runtime dynamic lookup. Variables (static or not) are never polymorphic.
This is an SCJP question, and as a matter of policy, these get moved to the SCJP forum.