Double-Checked Locking can be implemented in Java 5, if you do it just right. The general opinion seems to be that there are better ways to do it, though.
This ensures that Foo is lazily initialized when the getFoo() method is first called, because of the implications of the static keyword in the context of class initialization. Also, because of static initilization there's no need for synchronization. See the JLS for more details, because these are all the details I remember, having read Java Concurrency in Practice a good while ago. [ September 11, 2008: Message edited by: Jelle Klap ]
Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.