How to Create JSON Array in Java

前端 未结 3 643
陌清茗
陌清茗 2020-12-08 23:45

I have a JSON structure as given below. How can I create this Array structure programmatically?

JSON srtucture:

{ 
\"Employee\": 
         


        
相关标签:
3条回答
  • 2020-12-09 00:07

    XStream provides a very convenient way to transform JSON to JAVA and back. Its annotation based and does the conversion job pretty well. Check XStream

    0 讨论(0)
  • 2020-12-09 00:09

    I'd probably use the GSON library which will marshall Java objects.

    There's an array example to get you started, as well as a ton of others in the user guide.

    0 讨论(0)
  • 2020-12-09 00:16

    use the following link the complete structure of the JSON explained.

    http://json.org/java/

    0 讨论(0)
提交回复
热议问题