This static initialization occurs automatically when the class containing the variable is first accessed. This does not include the static initializer, which occurs at compile time. The process of Lazy Instantiation, on the other hand, doesn't automatically allocate variables. It enables the creation of objects to be put off until they are actually needed. Instead of being created when the program first starts, the creation of variables managed via Lazy Instantiation is deferred until they are actually required.
Lets start off with some examples.
In Listing 2, object1 is created and its value is initialized when the class MyClass is first accessed. Here is a similar code segment making use of Lazy Instantiation. The code in Listing 3 performs the same function as in Listing 2 except that the object1 variable is being managed via Lazy Instantiation. When MyClass is created, nothing is done with object1 other than implicitly setting its reference to null. If it does not exist, an instance is created and then used.