I\'m following this MOOC on OOP in Java and it has presented an example I don\'t fully understand. In the example, a Book class has been created and they are const
Book
after
if (getClass() != object.getClass()) { return false; }
you can be sure your object is a book, but java still does not know it
so you can savely tell it to try the casting with
Book compared = (Book) object;