动态绑定== Java中的后期绑定? [英] Dynamic binding == late binding in Java or not?

查看:71
本文介绍了动态绑定== Java中的后期绑定?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在不同的来源中,我读到了关于该主题的不同文章.例如,维基百科说:

In different sources i've read different things on the topic. For example Wikipedia says:

后期绑定通常与动态调度相混淆,但是存在显着差异.

Late binding is often confused with dynamic dispatch, but there are significant differences.

但是几行之后

在Java编程中经常使用术语后期绑定作为动态调度的同义词.具体来说,这是指Java与虚拟方法一起使用的单一调度机制.

it is popular to use the term late binding in Java programming as a synonym for dynamic dispatch. Specifically, this refers to Java's single dispatch mechanism used with virtual methods.

那么真相在哪里,这是什么显着差异"?

So where's the truth and what are this "significant differences"?

推荐答案

对于所有意图和目的,后期绑定和动态单次分发都是相同的.在动态单调度中,单个对象的值或标识确定在运行时调用哪个代码,这就是Java中发生的情况.

Late binding and dynamic single dispatch are, for all intents and purposes, the same. In dynamic single dispatch, the value or identity of a single object determines which code is invoked at runtime, and that's what happens in Java.

一般来说,术语动态调度通常用于表示动态 multiple 调度,这是在运行时根据运行时的标识或值选择运行时方法的地方. 一个以上的对象,这是CLOS和Smalltalk中的一种语言功能,但不是Java或C ++中的语言功能.

The term dynamic dispatch in general is most often used to imply dynamic multiple dispatch, which is where the runtime method is chosen at runtime based on the identities or values of more than one object, which is a language feature in CLOS and Smalltalk, but not in Java or C++.

这篇关于动态绑定== Java中的后期绑定?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆