title: java non-static method cannot be referenced from a static context
body: <p>Here's my code:</p>
  
  <pre><code>public abstract class Function{
      public abstract double evaluate(double x);
      public double findRoot(double a, double b, double epsilon){
          if( (evaluate(a) &gt; 0 &amp;&amp; evaluate(b) &gt; 0) || (evaluate(a) &lt; 0 &amp;&amp; evaluate(b) &lt; 0)){
              System.out.println("There is no root between these two points.");
          }
          double x = (a+b)/2;
          if(Math.abs(a-x) &lt; epsilon){
              return x;
          }
          else if((evaluate(x) &lt; 0 &amp;&amp; evaluate(a) &lt; 0) || (evaluate(x) &gt; 0 &amp;&amp; evaluate(a) &gt; 0)){
              return findRoot(x, b, epsilon);
          }
          else{
              return findRoot(a, x, epsilon);
          }
      }
      public static void main(String[] args){
          double testSinFunc = SinFunc.findRoot(3, 4, .01);
          double testCosFunc = CosFunc.findRoot(1, 2, .01);
          if(testSinFunc == 3.14){
              System.out.println("SinFunc.findRoot(3, 4, .01) returned 3.14. Test passed!");
          }
          if(testCosFunc == 1.57){
              System.out.println("CosFunc.findRoot(1, 2, .01) returned 1.57. Test passed!");
          }
      }
  }
  </code></pre>
  
  <p>The compiler says :</p>
  
  <blockquote>
    <p>non-static method findRoot(double, double, double) cannot be
    referenced from a static context</p>
  </blockquote>
  
  <p>What would I do to fix this?</p>