2015-07-24 11:32:22 +03:00
|
|
|
package com.iluwatar.lazy.loading;
|
2015-04-10 20:24:16 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* Heavy objects are expensive to create.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
public class Heavy {
|
|
|
|
|
|
|
|
public Heavy() {
|
|
|
|
System.out.println("Creating Heavy ...");
|
|
|
|
try {
|
|
|
|
Thread.sleep(1000);
|
|
|
|
} catch (InterruptedException e) {
|
|
|
|
e.printStackTrace();
|
|
|
|
}
|
|
|
|
System.out.println("... Heavy created");
|
|
|
|
}
|
|
|
|
}
|