The following code in your programme
System.out.println(b1);
System.out.println(tree);
internally it means:
System.out.println(b1.toString());
System.out.println(tree.toString());
the method toString() in the above code returns String Representation of your object's hashcode which is a unique code for each object in
java.
if you want to get the String value specified by you in the Constructor as title property of your book class you must override toString() method
from the Object's Class and write your code to print the title of your book like i mentioned below.
now the code
System.out.println(b1);
will print it's title("How cats work") on your console.