I have a callback interface.
public interface CallBack{
void executeforConn();
}
abstract class CallbackImpl implements Callback {
void executeforConn(){
executeStatements();
}
abstract void executeStatements();
}
In the caller the callback is called.
new CallbackImpl{
@Override
executeStatements(){
//extend the method
}
}
Callback callback = new CallbackImpl();
callback.executeforConn();
The caller calls the implementation of callback method. What I do not understand why is it called a callback method. I know by using interface you get the flexibility to register any class which implements CallBack with the Caller. It doesn't have to be just CallBackImpl.