Java - Virtual Methods

前端 未结 3 847
暗喜
暗喜 2020-12-08 16:23

How does virtual functions work behind the scenes in Inheritance ? Does the compiler treat virtual functions specially ?

3条回答
  •  悲&欢浪女
    2020-12-08 16:46

    'Virtual' is a C++ term. There are no virtual methods in Java. There are ordinary methods, which are runtime-polymorphic, and static or final methods, which aren't.

提交回复
热议问题