I am aware that in C++, there is a virtual pointer in each instance pointing to a virtual table. But how is dynamic binding implemented in Java?
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
Just to be picky, it's a real pointer to a real table of virtual functions, hence the name "virtual function table," often abbreviated as "vft". It is also commonly abbreviated "vtbl" which doesn't help matters.
Java probably does something fairly similar.
I guess I will answer my own question. Basically, an object stores a reference to its class object, where the dynamic binding will be forwarded from an object to.