KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
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 . The way I understand it, a class basically has a virtual table of methods and when calling a method with either invokevirtual or invokeinterface this virtual table is consulted. What is the difference, then, between a method that's defined on an interface and a method defined on a base class? Why the different bytecodes? The description of the instructions also looks very similar. The article seems to claim that the method table of an interface can have "different offsets" every time a method is called. What I don't understand is why an interface would have a method table at all, since no object can have the interface as its actual type. What am I missing?
Tags (comma-separated)
Save Edits
Cancel