I have a object list-
List<Object> sample = new ArrayList<Object>();
and it contain following values-
[This is an apple., Ram is a boy., What is your name?].
I want to modify it like this-
[{ "q": "This is an apple." }, { "q": "Ram is a boy" }, { "q": "What is your name?" }]
How to do it?
P.S - I am new to Java. Thanks for your help in advance.
qfield (that you should name much better), put instances of that class in a list. Make sure to use the right generic type for your list: List<MayNewClass>.