I know that all objects are created at runtime when a function is called.
Binding is when we bind the members of these methods inside the class.
early binding binds all method instance variables at compile time. I thought that all objects are created at runtime, so it should also bind all elements of the given methods at runtime.
Why, with early binding, is an object method call defined at compile time? if this object is created at runtime.
eg.
class A{
public void foo(){
}
}
public static void main(String[] args){
A aInstance = new A();
aInstance.foo();
}
foo () was resolved at compile time, but aInstance is determined at runtime.
source
share