Pages

Thursday, February 01, 2007

Lazy Loading Example

Alex found a great example of the Initialization on Demand Holder idiom in java.lang.Integer. I've actually looked at this code before but wasn't familiar enough with the pattern to recognize it. Very cool. Thanks, Alex.

2 comments:

  1. Anonymous10:33 AM

    Who will take bets that even "Hello World" lazily creates the holder?

    ReplyDelete
  2. I wrote up a note discussing the introduction of this code into java.lang.Integer.

    ReplyDelete