you can do this.getClass();
to get the class of the calling object.
you can get the class name by this.getClass().getName()
.
Or else you can use instanceof operator to check which class the calling object belongs to.
So in your base class function you can simply check:
if(this instanceof ClassA){
}