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

问题描述

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

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

但是几行之后

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

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中的后期绑定?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-19 08:14