What is the difference between static and dynamic polymorphism?

Static polymorphism:

  • memory allocated at compile time is called as static allocation.
  • java resolves calls to overloading methods at compile time is called as Static polymorphism.

Dynamic polymorphism:

  • memory allocated at run time is called as dynamic allocation
  • java resolves calls to overloading methods at run time is called as Dynamic polymorphism or Dynamic binding or Dynamic dispatch.
  • This principle is used to create reference variable.