Java "partial" override

public class A extends B{

  @Override
  public void foo(){
    System.out.println("yep");
    super.foo(); // calls the method implemented in B
  }  
}

Simply call super.methodName() to call your supertype's version of the method.

public class A extends B{
  @Override
  public void foo(){
    System.out.println("yep");
    super.foo(); // Here you call the supertype's foo()
  }
}

Also, this isn't 'partially' overriding the method. You are fully overriding it, but you are just using some of the parent's functionality.


The use of the Keywork super is meant for this

super.foo();