Why do we say that a static method in Java is not a virtual method?

前端 未结 5 1798
北恋
北恋 2021-01-05 06:58

In object-oriented paradigm, a virtual function or virtual method is a function or method whose behavior can be overridden within an inheriting class by a f

5条回答
  •  感情败类
    2021-01-05 07:32

    Because polymorphism applies to objects, while a static method doesn't relate to any object (but to a class).

提交回复
热议问题