title: source == button in Java
body: <p>I was wondering why do we use the sign == when comparing a button to the source in the actionPerformed method?</p>
  
  <pre><code>public void actionPerformed(ActionEvent e) {
      Object source = e.getSource();
  
      if(source == button)
  
  
  }   
  </code></pre>
  
  <p>Usually in Java, we use .equals() to compare two objects but in this case we use == instead.</p>
  
  <p>Why ?</p>