Printing a TreeMap using a for loop in Java
<p>I use the following code:</p>

<pre><code>public void showTablet () {
    for (Map.Entry&lt;String, Tablet&gt; entry : tableMap.entrySet()) {     
        System.out.println(entry.toString());
    }
}
</code></pre>

<p>The result is :</p>

<pre><code>MyBrand : A123=Brand: MyBrand, Model no.:A123, Price:3000.0
BrandTwo : T222=Brand: BrandTwo, Model no.:T222, Price:2500.0
</code></pre>

<p>My wanted result</p>

<pre><code>Brand: MyBrand, Model no.:A123, Price:3000.0
Brand: BrandTwo, Model no.:T222, Price:2500.0
</code></pre>

<p>Why is the key also printed out? </p>
