title: java.util.Map.Entry cannot be resolved error
body: <p>I tried the following code as</p>
  
  <pre><code>package collectconstructor;
  import java.util.Iterator;  
  import java.util.Map;  
  import java.util.Set;  
  
  public class QuestionMap {
  
  private int id;  
  private String name;  
  private Map&lt;String,String&gt; answers;  
  
  
  public QuestionMap(int id, String name, Map&lt;String, String&gt; answers) {  
      super();  
      this.id = id;  
      this.name = name;  
      this.answers = answers;  
  }  
  
  public void displayInfo(){  
      System.out.println("question id:"+id);  
      System.out.println("question name:"+name);  
      System.out.println("Answers....");  
      Set&lt;Entry&lt;String, String&gt;&gt; set=answers.entrySet();  
      Iterator&lt;Entry&lt;String, String&gt;&gt; itr=set.iterator();  
      while(itr.hasNext()){  
          Entry entry= itr.next();  
          System.out.println("Answer:"+entry.getKey()+" Posted By:"+entry.getValue());  
      }  
  }  
  
  }
  </code></pre>
  
  <p>Here in the following code snippet</p>
  
  <pre><code> Set&lt;Entry&lt;String, String&gt;&gt; set=answers.entrySet();  
   Iterator&lt;Entry&lt;String, String&gt;&gt; itr=set.iterator(); 
  </code></pre>
  
  <p>I got the error as the </p>
  
  <p>Multiple markers at this line</p>
  
  <ul>
  <li><p>The method entrySet() from the type Map refers to the missing type 
   Map$Entry</p></li>
  <li><p>Entry cannot be resolved to a type </p></li>
  </ul>
  
  <p>Can anybody explain as Why I am getting this error?</p>
  
  <p>Also I tried importing</p>
  
  <pre><code>import java.util.Map.Entry;
  </code></pre>
  
  <p>but got same error..
  please help!!</p>