This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
the "TimeTravel" example in K&B (page 198, assignments chapter)made me curious to look how unitialized method-local variables appear in bytecode (I'm using jclasslib bytecode viewer to view it).
In fact, I see that the int variable day, which is never initialized, does not appear in main's code. Inspecting the local variable table, I see it is not listed either. Yet adding further variables shows that even for such uninitialized variables, slots are reserved (numbering takes them into account), even though, as I said, they are not listed.
Now my question is, are they "still there" somewhere in the bytecode? Or are they optimized away?