Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7066575
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:05:53+00:00 2026-05-28T05:05:53+00:00

I am learning how to use HashMaps, my test project is working, but i

  • 0

I am learning how to use HashMaps,

my test project is working, but i need to get rid of some warnings,

public static void main() {


    Map <String, String>mMap = new HashMap<String, String>(); //crea nuevo HashMap
    mMap.put("llave 1", "la llave uno"); //le mete cosas al hashMap
    mMap.put("llave 2", "la llave dos");
    mMap.put("llave 3", "la llave tres");
    mMap.put("llave 4", "la llave cuatro");

    Iterator iter = mMap.entrySet().iterator();

    while (iter.hasNext()) {
         Map.Entry menEntry = (Map.Entry) iter.next();

         Log.d("msg", "key:"+menEntry.getKey() +" value:"+menEntry.getValue());
    } } }

so on

Iterator iter = mMap.entrySet().iterator();

i get the warning: multiple markers at this line the autocompletition point to Iterator <E> what is this, the cast?, Error?, what to put in there?

also same warning in:

Map.Entry menEntry = (Map.Entry) iter.next();

Thanks a lot!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T05:05:54+00:00Added an answer on May 28, 2026 at 5:05 am

    Its because you are not defining the type at couple of place, that is

    Iterator<Entry<String, String>> iter = mMap.entrySet().iterator(); 
    

    and

     Map.Entry<String, String> menEntry = (Map.Entry<String, String>) iter.next();
    

    Edit

    You can have a look at Generics in JAVA 1.5, here is a small explanation for that.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm learning to use the fantastic enlive library to do some web-scraping. I need
I’m learning to use the MVC 3 Framework, but I'm having some problems understanding
I am learning to use LabVIEW as part of my honours project, and was
I am learning to use polymorphism in C#, but cannot figure out this one.
I am learning to use the Dvorak keyboad layout, but I am not good
I am learning to use json_decode . I want to try out some php
I'm learning to use the PHP interactive shell, but I'm having trouble with multi-line
I am learning to use mysql.So, I got some problems. I have three table
I'm learning to use cucumber, in order to test email parsing and am running
I'm currently learning to use Core Data on iOS , in my test application

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.