Case for composition and extension

I wonder if the following approach would be useful in certain situations?
Or is it just a hack or some kind of workaround when you try to modernize something …

Public class ClassA () {
void method publicA () {
...
}
}


Public class ClassB Extends ClassA {
private class memberA;

public ClassB (ClassA a) {
memberA = a;
}

@Override
void method publicA () {
supermethodA ();
}

public void methodB () {
...
}
}