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

  • Home
  • SEARCH
  • 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 8649757
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T13:38:24+00:00 2026-06-12T13:38:24+00:00

I have Map<String,String> in java like this : {card_switch=Master, issuing_bank=ICCI, card_Type=DebitCard} I’m using the

  • 0

I have Map<String,String> in java like this :

{card_switch=Master, issuing_bank=ICCI, card_Type=DebitCard}

I’m using the simple json parser to parse this map into json object.

I tried :

Object json = JSONValue.parse(entry.getKey());

But I get an error message :

Object json = JSONValue.parse(entry.getKey());
                      ^
method JSONValue.parse(String) is not applicable
  (actual argument Map<String,String> cannot be converted to String by method invocation conversion)
method JSONValue.parse(Reader) is not applicable
  (actual argument Map<String,String> cannot be converted to Reader by method invocation conversion)

Is that possible to convert Map<String,String> into json?

  • 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-12T13:38:26+00:00Added an answer on June 12, 2026 at 1:38 pm

    Have a look at example 1.4 on this page http://code.google.com/p/json-simple/wiki/EncodingExamples#Example_1-4_-_Encode_a_JSON_object_-_Using_Map_and_streaming:

     Map obj=new LinkedHashMap();
       obj.put("name","foo");
       obj.put("num",new Integer(100));
       obj.put("balance",new Double(1000.21));
       obj.put("is_vip",new Boolean(true));
       obj.put("nickname",null);
       StringWriter out = new StringWriter();
       JSONValue.writeJSONString(obj, out);
       String jsonText = out.toString();
       System.out.print(jsonText);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some Java code like this : Map<Map<String,String>,String> map = new HashMap<>(); int
I have a Hashmap in Java like this: private Map<String, Integer> team1 = new
I have code like this: val dm = List[String]() val dk = List[Map[String,Object]]() .....
Is there some way of initializing a Java HashMap like this?: Map<String,String> test =
I would like to map data to java.util.Map attribute with MyBatis. I have simple
I have a Map containing a mixture of types like in this simple example
I have a java map with string in its key and integer in its
I have an unordered map: class O(val a: Int) Map[String, List[O]] which I'd like
I have this as a return type in Scala Map[String, Seq[Map[String, Seq[MyClass]]]] I have
i need a thread safe map, i have something like this: (i'm very new

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.