title: Java substitute for function pointers
body: <p>I'm looking to create a Sigma method. Coming from C I could use a function pointer, but I'm not certain of a similar construct of C. It seems that I could use Lambdas, though I'm unfamiliar of how they work outside of Scheme. If anyone could help me modify the code below it would be greatly appreciated.</p>
  
  <pre><code>public static int Sigma( int n , function f(int)) {
       int sum = 0;
       for(int i = 0; i &lt; n; i++)
            sum = sum + f(i);
       return sum;
  }
  </code></pre>