title: How do you pass operators as arguments?
body: <p>I want to pass one of four operators (+, -, *, /) to a method, and have it perform an operation on two integers based on which operator was passed.</p>
  
  <pre><code>static int op(String oper) {
      eval = 8 oper 4;
  }
  </code></pre>
  
  <p>e.g. if I call it with <code>op("+");</code>, it'll add <code>8</code> and <code>4</code>.</p>
  
  <p>Right now, I just get a "<code>;</code> expected" after <code>8</code>.</p>
  
  <p>Is there some other syntax I should use?  I'm just trying to cut down the size of some code.</p>