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 7082817
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:06:06+00:00 2026-05-28T07:06:06+00:00

Im an Android noob, coming from objC, I have a very stupid question (project

  • 0

Im an Android noob, coming from objC,

I have a very stupid question (project working fine and logging expected results),

package com.orchard.hasho;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import android.util.Log;

public class Numa {

public static void main() {


    Map mMap = new HashMap(); //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());
    }


}
}

IN the last code i have a new HashMap, wich i load elements to,

But I get many warnings,

ie, Map mMap = new HashMap(); warning: add type arguments to "Map"

I have noticed that when i create the Map… the autocompletition gives me an option of Map<K, V>

but from my tutorial i dont see this <Key, Value> ? ??? syntax’s when creating the Hashmap or populating it?

so what are this warnings, why the autocompetition gives me the option Map<K, V>, and how to fix the warnings?, thanks!

  • 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-28T07:06:06+00:00Added an answer on May 28, 2026 at 7:06 am

    This is due to generalization feature in java 1.5, you can specify what type of object this map will contain, like if you want to use String as a key and value, please use following:

    Map<String, String> mMap = new HashMap<String,String>();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am a noob learning Android via a book, i have a quick question.
I'm kind of a noob in the android world, and doing a pet project
This is an Android noob question. I am trying to start an activity of
Okay, first, I'm a noob at android programming. I have taken some Java, but
This is going to be a real noob question, so please have mercy. I
I am a complete Android and C in general noob, I have done a
I'm new to android developing, so i apologise if this is a simple/noob-ish question,
im quite new to android, so i apologise if this is a noob-ish question
first of all, i'm a noob at java programing for android. Now, I have
I am a noob to Android (and Java). I have successfully setup Eclipse and

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.