// with java14: compile: `javac --enable-preview --source 14 Book2.java` // run: `java --enable-preview Book` // or: `jshell --enable-preview` then `/open Book2.java` record Book(String title, String author, int numPages, boolean isCopyrighted) { // Template for any book-processing function: /* ??? funcForBook( /*Book this// ) { ... this.title this.author this.numPages this.isCopyrighted } */ public static void main( String... args ) { Book cih = new Book("The Cat in the Hat", "Seuss", 37, false); System.out.println( cih ); //cih.deriveFrom(...) //deriveFrom( cih, ....) } }