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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T20:13:54+00:00 2026-06-10T20:13:54+00:00

The following code public List<Map<String,String>> getPhoneData() { List<Map<String, String>> mapp = new List<Map<String, String>>();

  • 0

The following code

public List<Map<String,String>> getPhoneData() {
    List<Map<String, String>> mapp = new List<Map<String, String>>();
    Map<String, Integer> temp
         = new Map<String, Integer>{'type' => 'Profile Value', 'count' => 1};
    return mapp;
}

is giving me

Compile Error: Invalid value type: String for Integer

at line 3

I want to create Map with one value String and other Integer. How to do that?

  • 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-06-10T20:13:56+00:00Added an answer on June 10, 2026 at 8:13 pm

    Remove the quotes from around the numbers like this:

    Map<String, Integer> temp = new Map<String, Integer>{'type' => 123, 'count' => 1};
    

    EDIT:
    As you changed your question completely, the best way of achieving this would be:

    public List<Map<String,String>> getPhoneData() {
        List<Map<String, String>> mapp = new List<Map<String, String>>();
        Map<String, String> temp = new Map<String, String>{'type' => 'Profile Value', 'count' => '1'};
        return mapp;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code: public List<IWFResourceInstance> FindStepsByType(IWFResource res) { List<IWFResourceInstance> retval = new
i have the following code: public static void Serialize() { List<string> dirs = FileHelper.GetFilesRecursive(fileDirectoryPath);
I am trying the following code in eclipse: public class A { List<Integer> intList
Consider the following C# code: [XmlRoot] public class A { [XmlArray] public List<B> ArrayOfBItems
I have the following code: Public Shared Function GetAvailableManufacturers() As List(Of Manufacturer) 'first get
Can someone explane the following code for me? public class StoreEditorViewModel { public List<Ticket>
How would you test the following code? public IList<T> Find(DetachedCriteria criteria) { return criteria.GetExecutableCriteria(session).List<T>();
please have a look at the following code import java.util.ArrayList; import java.util.List; public class
I'm confused by the following code: import java.util.ArrayList; import java.util.LinkedList; import java.util.List; public class
In my code I am creating a List<> of the following class: public class

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.