title: Java ; expected error
body: <p>This is the first part of my code: </p>
  
  <pre><code>import acm.program.*;
  public class BisectionMethod extends Program {
  public void run () {
   double m, y, E, value;
   double a=readDouble("Enter a");
   double b=readDouble("Enter b");
   double f(double x) {
    return value=readDouble("Enter a function using x.");
   }
  </code></pre>
  
  <p>After compiling, it tells me "; expected" on ( and ) of the line:  double f(double x) {</p>
  
  <p>What am I doing wrong? I'm new to java so I'm sorry if there are any other major mistakes. I am trying to use a function, f(x) which I believe is written the way I have shown, but I keep getting the same error.</p>