quanke
Thinking in Java (Java 编程思想)

Updated a month ago

Charley Qing (@charleyqing) started discussion #29

7 months ago · 0 comments

Open

有些语言要求我们用一个特殊的关键字来允许动态绑定。在C++中,这个关键字是virtual。在Java中,我们则完全不必记住添加一个关键字,因为函数的动态绑定是自动进行的。所以在将一条消息发给对象时,我们完全可以肯定对象会采取正确的行动,即使其中涉及上溯造型之类的处理。

1.6 多形对象的互换使用 (Edit this file)

No need to add virtual in java

No description provided.

No comments on this discussion.


to join this conversation on GitBook. Already have an account? Sign in to comment
Notifications

You’re not receiving notifications from this thread.


1 participant