i found many examples to parse java object to Json.
Thanks for that.But i have one issue, i want Json in following format
{
"parent":
{
"sub-parent-1":
{
"child-1": 1,
"child-2": 2
},
"sub-parent-2":
{
"child-2": 3
}
}
}
Is it possible with java.
Please answer.Thanks in advanced..
Create Current Json String as in Java :
and finalparent JsonObject output as: