title: Map.Entry: How to use it?
body: <p>I'm working on creating a calculator.
  I put my buttons in a <code>HashMap</code> collection and when I want to add them to my class, which extends <code>JPanel</code>, I don't know how can I get the buttons from my collection.
  So I found on the internet the 2 last lines of my code, but I don't know their meaning.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>import java.awt.Component;
  import java.util.HashMap;
  import java.util.Iterator;
  import java.util.Map;
  import java.util.Set;
  
  import javax.swing.JButton;
  import javax.swing.JPanel;
  
  
  public class PanneauCalcul extends JPanel {
  
      private HashMap&lt;String, JButton&gt; listbouton = new HashMap&lt;String, JButton&gt;() ;
  
      public PanneauCalcul() {
          for(int i = 0; i &lt; 10; i ++) {
              listbouton.put("num" + i, new JButton("" + i)) ;
          }
  
          listbouton.put("add", new JButton("+")) ;
          listbouton.put("soustract", new JButton("-")) ;
          listbouton.put("multiply", new JButton("x")) ;
          listbouton.put("divise", new JButton("/")) ;
          listbouton.put("equal", new JButton("=")) ;
  
          Set entrys = listbouton.entrySet() ;
  
          Iterator iter = entrys.iterator() ;
  
          while(iter.hasNext()) {
              Map.Entry me = (Map.Entry)iter.next();  //don't understand 
              this.add((Component) me.getValue()) ;   //don't understand
          }
  
          EcouteCalcul ecout = new EcouteCalcul(this) ;
      }
  }
  </code></pre>
  
  <p>I don't understand how can we use <code>Map.Entry</code>--which is an interface--without redefining <code>Map.Entry</code>'s functions.</p>