I have a list -
List<Item> items = new ArrayList<Item>;
which consists of items - [firstname , abc , lastname , pqr , id , 1 ]
I need to convert this list to JSONObject of below format in java using json simple lib -
{"firstname":"abc","lastname":"pqr","id":"1"}
How can I achieve this? I am just a beginner.Any help would be appreciated.Thankyou in advance.