This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
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.