Late Binding in Java

前端 未结 5 743
不知归路
不知归路 2020-12-16 19:14

I have searched through all the similar questions on late binding on stack overflow, and I would severely disagree with anyone who marks this question as a duplicate. First

5条回答
  •  Happy的楠姐
    2020-12-16 19:46

    Wrong on all counts. The method to be called is decided at runtime, in every case here, based on the runtime type of the object. The only decisions made at compile time are for calls to final, private, or static methods, or choices among a set of overloaded methods (which could still lead to runtime choices if the overloaded methods are not final, private, or static.)

提交回复
热议问题