Every so often, even after working with Java for 10 years, you will find yourself blundering into a blindingly obvious solution to a small problem that you never even remotely considered before. After I finished bonking myself on the head for never thinking of them before, I thought I would share what I have stumbled across in the last few weeks.
I have been playing with another language recently, and one of the little tricks I have found really interesting is the concept of code blocks. Unfortunately, Java doesn't really have this built into the language, but that doesn't mean you can't simulate them and have nearly as much fun.
Scope pointers in Java, surely you jest! Well, not exactly, but a fun, possibly instructive exercise nonetheless.