Why doesn't Java allow overriding of static methods?

后端 未结 22 2739
谎友^
谎友^ 2020-11-21 05:49

Why is it not possible to override static methods?

If possible, please use an example.

22条回答
  •  醉梦人生
    2020-11-21 06:15

    By overriding we can create a polymorphic nature depending on the object type. Static method has no relation with object. So java can not support static method overriding.

提交回复
热议问题