Static binding and dynamic binding in Java

JavaJava Programming Java 8

Yes! When compiler knows which objects to be used for method execution, it can statically bind the reference to the object. For example, static variables, private, final variables are using static binding. Whereas if object identification is to be done at runtime then the dynamic binding is used. Method overriding is a case of dynamic binding.

Whereas method overloading is a case of static binding.

Published on 02-Feb-2018 17:12:33