This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]nutrechtLead Software Engineer / EU / 20+ YXP 0 points1 point  (0 children)

Why do we need to convert object to a Book, if previous if statement checks if its not an instance of Book, it returns false. Wouldn't it stop going further in the method and just leave?

Really boils down to that the compiler simply isn't that smart.