title: How to make multiple criterias in an if statement
body: <p>I was wondering if I could get some help to make my <code>if</code> statements more compact. For example making these if-statements into one if possible with using <code>&amp;&amp;</code> or something. The different buttons have different values.</p>
  
  <pre><code>public void actionPerformed(ActionEvent ae) {
  if(ae.getSource() == button[0])                 
      display.append("7");                         
  if(ae.getSource() == button[1])
      display.append("8");
  if(ae.getSource() == button[2])
      display.append("9");
   }
  </code></pre>