3 ms·
>Java offers only vtable dispatch or switch on integers/enums The JVM has complete knowledge of the class hierarchy. If a method has not been replaced in a sub
by imtringued 8y ago
>Java offers only vtable dispatch or switch on integers/enums
The JVM has complete knowledge of the class hierarchy. If a method has not been replaced in a subclass then no vtable entry has to be generated and the JVM just uses a static call.
- willtim 8y agoMy point was that often one has to structure code across classes to get efficient branching. Any details regarding optimisation for virtual dispatch doesn't change this fact.