Top News

Explain the difference between static and dynamic binding?

 


In Static binding references are resolved at compile time. In
Dynamic binding references are resolved at Run time.
E.g.
Person p = new Person();
p.walk(); // Java compiler resolves this binding at compile time.
public void walk(Object o){
((Person) o).walk(); // this is dynamic binding.
}

Post a Comment

Previous Post Next Post