Consider the following class
class A{
public void init(){
//do this first;
}
public void atEnd(){
//do this after init of base cl
Make init()
final
, and provide a separate method for people to override that init()
calls in the middle:
class A{
public final void init(){
//do this first;
}
protected void initCore() { }
public void atEnd(){
//do this after init of base class ends
}
}
class B1 extends A{
@Override
protected void initCore()
{
//do new stuff.
}
}