diff --git a/core-java-modules/core-java-lang-4/src/main/java/com/baeldung/bookstore/Book.java b/core-java-modules/core-java-lang-4/src/main/java/com/baeldung/bookstore/Book.java new file mode 100644 index 0000000000..83ed76bab0 --- /dev/null +++ b/core-java-modules/core-java-lang-4/src/main/java/com/baeldung/bookstore/Book.java @@ -0,0 +1,21 @@ +// The next line is commented out to avoid the code to fail the build. +// package com.baeldung; + +/** +* If the below package declaration is commented out and the above incorrect package +* declaration is uncommented, then the problem will replicate. +*/ +package com.baeldung.bookstore; + +public class Book { + + private String title; + private String author; + private long isbn; + + public Book(String title, String author, long isbn) { + this.title = title; + this.author = author; + this.isbn = isbn; + } +} diff --git a/core-java-modules/core-java-lang-4/src/main/java/com/baeldung/bookstore/LibraryAdmin.java b/core-java-modules/core-java-lang-4/src/main/java/com/baeldung/bookstore/LibraryAdmin.java new file mode 100644 index 0000000000..9abd654589 --- /dev/null +++ b/core-java-modules/core-java-lang-4/src/main/java/com/baeldung/bookstore/LibraryAdmin.java @@ -0,0 +1,14 @@ +package com.baeldung.bookstore; + +import java.util.Random; + +public class LibraryAdmin { + + public Book createBook(String title, String author) { + + final long isbn = new Random().nextLong(); + + return new Book(title, author, isbn); + } + +} \ No newline at end of file