mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-19 23:26:07 +00:00
22 lines
390 B
Java
22 lines
390 B
Java
package com.iluwatar.resourceacquisitionisinitialization;
|
|
|
|
import java.io.Closeable;
|
|
import java.io.IOException;
|
|
|
|
/**
|
|
*
|
|
* TreasureChest resource
|
|
*
|
|
*/
|
|
public class TreasureChest implements Closeable {
|
|
|
|
public TreasureChest() {
|
|
System.out.println("Treasure chest opens.");
|
|
}
|
|
|
|
@Override
|
|
public void close() throws IOException {
|
|
System.out.println("Treasure chest closes.");
|
|
}
|
|
}
|