I know that all objects are created at runtime when the function is called.
Binding is when we bind methods data members inside the class.
early binding is binding all the method instance variables at compile time. I thought all objects are created at runtime so it must bind also all methods data members at runtime.
Why in early binding the call to an object method is determined at compile time? if that object is created at runtime.
for example.
class A{
public void foo(){
//some code here
}
}
public static void main(String[] args){
A aInstance = new A();
aInstance.foo();
}
foo() was resolved at compile time, but aInstance is determined at runtime.