title: how to prevent super-class from calling overriden sub-class methods?
body: <p>I just ran into this issue, and it has taken me by surprise.</p>
  
  <p>super-class:</p>
  
  <pre><code>public class Foo {
  
      @Override
      public String toString(){
          return String.format("Result = %s", calculate());
      }
      public double calculate(){
          return 1;
      }
  }
  </code></pre>
  
  <p>sub-class:</p>
  
  <pre><code>public class Bar extends Foo {
      @Override
      public String toString(){
          return String.format("%s", super.toString());
      }
      @Override
      public double calculate(){
          return 123.456;
      }
  }
  </code></pre>
  
  <p>driver:</p>
  
  <pre><code>public static void main(String[] args) {
      System.out.println(new Bar().toString());
  }
  </code></pre>
  
  <p>The output I desire in this scenario is <code>1</code>
  The output I get is <code>123.456</code></p>
  
  <p>How do I prevent Foo's <code>toString()</code> from calling Bar's <code>calculate()</code> ?</p>