mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-16 06:58:54 +00:00
23 lines
368 B
Java
23 lines
368 B
Java
package com.iluwatar.lazy.loading;
|
|
|
|
/**
|
|
*
|
|
* Heavy objects are expensive to create.
|
|
*
|
|
*/
|
|
public class Heavy {
|
|
|
|
/**
|
|
* Constructor
|
|
*/
|
|
public Heavy() {
|
|
System.out.println("Creating Heavy ...");
|
|
try {
|
|
Thread.sleep(1000);
|
|
} catch (InterruptedException e) {
|
|
e.printStackTrace();
|
|
}
|
|
System.out.println("... Heavy created");
|
|
}
|
|
}
|