package feature;

/**
 * create singleton using enum
 */
public class BookDemo {
    public static void main(String[] args) {
        Book book = new Book("Java Programming", "John Doe", 300);
        System.out.println(book);

        // Using the singleton pattern
        BookEnum.INSTANCE.setBook(book);
        System.out.println(BookEnum.INSTANCE.getBook());
    }
}
