I want to generate following JSON dataobject using org.json.simple.JSONObject, how to do it in java?

Posted by Abhishek on Stack Overflow See other posts from Stack Overflow or by Abhishek
Published on 2010-03-15T18:53:22Z Indexed on 2010/03/15 19:19 UTC
Read the original article Hit count: 195

Filed under:
|
|

Hi all,

I want to genrate following JSON dataobject using org.json.simple.JSONObject, how to do it in java?

{
  friends : [
    {
      name: 'David',
      interests: 'Cooking',
    },
    {
      name: 'Charles',
      interests: 'Hiking',
    },
    {
      name: 'Mary',
      interests: 'Football',
    },
  ]
}

If code snipet is provided then that will be really helpful!

Regards, Abhi

© Stack Overflow or respective owner

Related posts about JSON

Related posts about java