Static Binding and Dynamic Binding

Your example is dynamic binding, because at run time it is determined what the type of a is, and the appropriate method is called. Now assume you have the following two methods as well: public static void callEat(Animal animal) { System.out.println(“Animal is eating”); } public static void callEat(Dog dog) { System.out.println(“Dog is eating”); } Even … Read more

Static Vs. Dynamic Binding in Java

From Javarevisited blog post: Here are a few important differences between static and dynamic binding: Static binding in Java occurs during compile time while dynamic binding occurs during runtime. private, final and static methods and variables use static binding and are bonded by compiler while virtual methods are bonded during runtime based upon runtime object. … Read more