|
关注:1
2013-05-23 12:21
求翻译:The isLargerThan method, as defined in the Relatable interface, takes an object of type Relatable. The line of code, shown in bold in the previous example, casts other to a RectanglePlus instance. Type casting tells the compiler what the object really is. Invoking getArea directly on the other instance (other.getArea()是什么意思?![]() ![]() The isLargerThan method, as defined in the Relatable interface, takes an object of type Relatable. The line of code, shown in bold in the previous example, casts other to a RectanglePlus instance. Type casting tells the compiler what the object really is. Invoking getArea directly on the other instance (other.getArea()
问题补充: |
|
2013-05-23 12:21:38
该isLargerThan方法,如可相关的接口定义,采用类型听上去很像的对象。
|
|
2013-05-23 12:23:18
isLargerThan方法,如对可靠的接口定义,采取可靠类型的对象。代码行,显示在大胆在先例中,熔铸其他对RectanglePlus事例。类型铸件告诉编译器什么对象真正地是。祈求getArea直接地在另一个事例(other.getArea ())不会编写,因为编译器不了解其他实际上是RectanglePlus事例。
|
|
2013-05-23 12:24:58
isLargerThan方法,如被定义在Relatable接口,采取类型Relatable对象。 代码行,显示在大胆在先例中,熔铸其他到RectanglePlus事例。 类型铸件告诉编译器什么对象真正地是。 祈求getArea直接地在另一个事例 (other.getArea()) 不会编写,因为编译器不了解其他实际上是RectanglePlus事例。
|
|
2013-05-23 12:26:38
忍俊不禁接口中定义的 isLargerThan 方法,需要一个 Relatable 类型的对象。代码,以粗体显示的行在前面的示例中,强制其他转换到一个 RectanglePlus 实例。类型强制转换告诉编译器的对象是什么。调用的其他实例直接上 getArea (other.getArea()) 将无法编译,因为编译器不会不明白另一个是实际的 RectanglePlus 实例。
|
|
2013-05-23 12:28:18
isLargerThan 方法,如定义在 Relatable 的界面,拿类型的一个物体 Relatable。在以前的例子中以粗体被显示的代码的线生产其他到一个 RectanglePlus 示例。输入投掷告诉编译器什么物体真的是。在其他示例直接调用 getArea (other.getArea()) 会无法编辑因为编译器不懂得那其他实际上是 RectanglePlus 的一个示例。
|
湖北省互联网违法和不良信息举报平台 | 网上有害信息举报专区 | 电信诈骗举报专区 | 涉历史虚无主义有害信息举报专区 | 涉企侵权举报专区