一旦把一个对象上溯给一个接口类型,只有该接口中指定的成员才可以被使用。
The idea of inheriting from a base class without being able to downcast to it or upcast to the base just seemed silly.继承一个基类而无法将它向下或向上转换到基类的理念是不明智的。
When you use the upcast operator, the compiler attempts to infer the type you are converting to from the context.在使用向上转换运算符时,编译器会尝试根据上下文来推断出要转换为的类型。