Is method hiding a form of Polymorphism?

后端 未结 5 1847
夕颜
夕颜 2021-01-03 04:06

Polymorphism is the ability to take many forms. Method overriding is runtime polymorphism.

My questions are:

  1. Is there anything like static polymor

5条回答
  •  离开以前
    2021-01-03 04:26

    Polymorphism

    Static Binding/Early binding/Compile time binding - Method overloading.(in same class)
    Dynamic binding/Runtime binding/Method overriding.(in different classes.)
    

    Polymorphism in java

    It just has two types, Method overloading and Method overriding, as soon as the method overriding turn into Method Hiding, it loses it's polymorphism features.

    refer to below question from stackoverflow.

    1.) Question1

    2.) Question2

提交回复
热议问题