Java - Virtual Methods

前端 未结 3 837
暗喜
暗喜 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:45

    All methods in java are virtual by default. That means that any method can be overridden when used in inheritance, unless that method is declared as final or static.

提交回复
热议问题