User111
User111

Reputation: 95

how to convert a string[] to json

I declared an array as below

String[] finalcodes = new String[50] ;

and assigning some values to it finally when I print finalcodes it results as below.

["aaa","bbb","ccc"]

but my requirement is to get it as a json object

so please suggest me how to convert my string array to JSON Object.

Upvotes: 1

Views: 110

Answers (1)

Habil
Habil

Reputation: 540

You can use jackson library also check your json is valid; http://jackson.codehaus.org/ / http://jsonformatter.curiousconcept.com/

Upvotes: 1

Related Questions