title: Why does toString function of a HashMap prints itself with a different order?
body: <p>I have this very simple piece of code, and I was just trying to play a bit with different kind of objects inside a Map.</p>
  
  <pre><code>//There's a bit of spanish, sorry about that
  //just think 'persona1' as an object with
  //a string and an int
  Map mapa = new HashMap();
  mapa.put('c', 12850);
  mapa.put(38.6, 386540);
  mapa.put("Andrés", 238761);
  mapa.put(14, "Valor de 14");
  mapa.put("p1", persona1);
  mapa.put("Andrea", 34500);
  
  System.out.println(mapa.toString());
  </code></pre>
  
  <p>And then I expect from console something like:</p>
  
  <pre><code>{c=12850, 38.6=386540, Andrés=238761, 14=Valor de 14, p1={nombre: Andres Perea, edad: 10}, Andrea=34500}
  </code></pre>
  
  <p>But susprisingly for me I got same data in different order:</p>
  
  <pre><code>{38.6=386540, Andrés=238761, c=12850, p1={nombre: Andres Perea, edad: 10}, Andrea=34500, 14=Valor de 14}
  </code></pre>
  
  <p>It doesn't matter if I try other kind of objects, even just Strings or numeric types, it always does the same, it makes a different without-apparently-any-sense order.</p>
  
  <p>Can someone give me a hint why this happens? Or may be something too obvious I'm missing?</p>
  
  <p>I'm using Java 1.7 and Eclipse Juno.</p>