title: how to get hashmap object value
body: <p>i have a code which put object as hashmap value. I want to read lat and lng from the hashmap using iterator class. But i dont know how to do this.here is my code.</p>
  
  <pre><code>Location locobj = new Location();
  HashMap loc = new HashMap();
  
  while(rs.next()){
        locobj.setLat(lat);
        locobj.setLng(lon);
        loc.put(location, locobj);
  
  }
  
        Set set = loc.entrySet();
        Iterator i = set.iterator();
        while(i.hasNext()) {
        Map.Entry me = (Map.Entry)i.next();
        System.out.println(me.getKey()+"value&gt;&gt;"+me.getValue()); 
        }
  </code></pre>
  
  <p>class location is like this</p>
  
  <pre><code>public class Location {
  
      private String lat;
      private String lng;
      private String name;
  
      public String getLat() {
          return lat;
      }
      public void setLat(String lat) {
          this.lat = lat;
      }
      public String getLng() {
          return lng;
      }
      public void setLng(String lng) {
          this.lng = lng;
      }
      public String getName() {
          return name;
      }
      public void setName(String name) {
          this.name = name;
      }
  
  }
  </code></pre>
  
  <p>how do i read locobj lat and lng value from getValue() method.please help</p>