This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.
static members are resolved (and thus initialised) in the order they are declared. As you're declaring k only after its first use in the initialisation of z you're getting an error. In the first case you're getting a forward reference which is resolved at runtime, in the second it's (attempted to be) resolved at compile time.