title: How to get Map value
body: <pre><code>import java.io.BufferedReader;
  import java.io.IOException;
  import java.io.InputStreamReader;
  import java.util.HashMap;
  import java.util.List;
  import java.util.Map;
  
  public class clsWarehouse {
  
  public static void main(String[] args){
  
      class Items {
          private String iItemID;
          private String strItemName;
          private String strItemDescription;
          private String iItemPrice;
          private String strSize;
          private String strSex;
  
  
      public Items (String id, String name, String description, String price, String size, String sex){
          iItemID = id;
          strItemName = name;
          strItemDescription = description;
          iItemPrice = price;
          strSize = size;
          strSex = sex;
          }
      }   
  
  
  Map&lt;Integer, Items&gt; ItemMap = new HashMap&lt;Integer, Items&gt;();
  ItemMap.put(1, new Items("3", "test1", "test2", "30", "20", "Male")); 
  
  for (Map.Entry&lt;Integer, Items&gt; entry : ItemMap.entrySet()) {
  System.out.println("Key = " + entry.getKey() + ", Value = " + entry.getValue());
  
          Items test = entry.getValue();
          String test2 = test.toString();
          System.out.println(test2);
      }  
  }
  }
  </code></pre>
  
  <p>Hello,</p>
  
  <p>I want to get the value stored in the map but i get only the memory locations instead, Key = 1, Value = clsWarehouse$1Items@c3c749. Can someone help me with this.</p>
  
  <p>Thanks!</p>