What is the point of invokeinterface?

后端 未结 2 864
逝去的感伤
逝去的感伤 2020-11-30 18:25

I\'m reading this article about how JVM invokes methods, and I think I got most of it. However, I\'m still having trouble understanding the need for invokeinterface

2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-30 18:59

    Comparing both instructions in the JVM Spec, the very first difference is that invokevirtual checks the accessibility of the method during the lookup, while invokeinterface doesn't.

提交回复
热议问题