• When a class has implemented an interface, objects created from that class can be upcast to the interface type, as demonstrated by Listing 12-3.

    当一个类已经实现了一个接口时,从这个类生成的对象可以上溯到这个接口类型,如清单12-3所示。

    youdao

  • Once an object has been upcast to an interface type, only the members specified in the interface can be used.

    一旦把一个对象上溯给一个接口类型,只有该接口中指定的成员才可以被使用。

    youdao

  • When you use the upcast operator, the compiler attempts to infer the type you are converting to from the context.

    在使用向上转换运算符时,编译器会尝试根据上下文来推断出要转换为的类型。

    youdao

  • As for the upcast operator, if the compiler cannot infer a specific target type from the context, it reports an error.

    对于向上转换运算符,如果编译器无法根据上下文推断出特定的目标类型,则将报告错误。

    youdao

  • When you upcast to a base interface, you can only access the members specified by that interface, just as for upcasting to base classes.

    当你上溯到基接口时,你只可以访问由那个接口所指定的成员,就像上溯到基类那样。

    youdao

  • When a class implements an interface that has multiple base interfaces, objects created from that class can be upcast to any of the base interface types.

    当一个类实现有多个基接口的接口时,从这个类生成的对象可以上溯到任何一个基接口。

    youdao

  • Since all objects in the class pool are upcast to their common base class, the polymorphism of the method leads to that which object method will be executed can only be ascertained at runtime.

    由于所有位于对象池中的对象都被上溯到它们的基类型,方法多态使得只有在运行时刻才能真正确定到底哪个对象的方法被执行。

    youdao

  • Since all objects in the class pool are upcast to their common base class, the polymorphism of the method leads to that which object method will be executed can only be ascertained at runtime.

    由于所有位于对象池中的对象都被上溯到它们的基类型,方法多态使得只有在运行时刻才能真正确定到底哪个对象的方法被执行。

    youdao

$firstVoiceSent
- 来自原声例句
小调查
请问您想要如何调整此模块?

感谢您的反馈,我们会尽快进行适当修改!
进来说说原因吧 确定
小调查
请问您想要如何调整此模块?

感谢您的反馈,我们会尽快进行适当修改!
进来说说原因吧 确定