tempusfugit (128) [Avatar] Offline
9.4.2 Implementing interfaces and casting p.254 - "upcast"

"When the conversion between the types cannot fail, it is called an upcast."

True, upcasts cannot fail but they are called upcasts because ...

Thinking in Java, Chapter 6: Why Upcasting?

"The reason for the term is historical, and based on the way class inheritance diagrams have traditionally been drawn: with the root at the top of the page, growing downward. ... Casting from a derived type to a base type moves up on the inheritance diagram, so it’s commonly referred to as upcasting. Upcasting is always safe because you’re going from a more specific type to a more general type. ... You can also perform the reverse of upcasting, called downcasting, but this involves a dilemma ...