title: How to retrieve key & values from hashmap
body: <p>I am trying to insert the values to hash map through object, and i want to check if the values are inserted in to hash map. so i am using this code but in runtime i am not able to get any output.</p>
  
  <p>How to resolve this? </p>
  
  <p>Code:</p>
  
  <pre><code>import java.util.*;
  import java.io.*;
  import java.lang.*;
  
  public class TaskList
  {   
  
      private static HashMap&lt;Integer, Object[]&gt; dataz = new HashMap&lt;Integer,Object[]&gt;();
      private static  HashMap&lt;Integer, Object[]&gt; screen_dataz = new HashMap&lt;Integer,Object[]&gt;();
      public final static Object[][] longValues = {{"10", "kstc-proc", "10.10.10.10.10.","5","O"},{"11", "proc-lvk1", "12.1.2.","4","O"},{"13", "trng-lvk1", "4.6.1.","3","O"}};
      private static String sl,pid,tid,mval,status;
  
      public static void main(String args[])
      {
          addTask();
      }
  
      public static void addTask()
      {  
          for (int k=0; k&lt;longValues.length; k++)
          {
          screen_dataz.put(k,longValues);
          }
          Set mapSet = (Set) screen_dataz.entrySet();
          Iterator mapIterator = mapSet.iterator();
          while (mapIterator.hasNext()) 
          {
          Map.Entry mapEntry = (Map.Entry) mapIterator.next();
          String keyValue = (String) mapEntry.getKey();
          String value = (String) mapEntry.getValue();
          System.out.println(value);
          }
      }
  }
  </code></pre>