I’ve to create from Java a JSON structure like this one:
[ [ timestamp , number ],[ timestamp , number ] ]
for using it on Highcharts graphs.
I’ve used a “LinkedList of LinkedList” structure that I’ve found formatting in json in the same way, and it works.
I wished to know if there’s another way to do it.
A LinkedList of LinkedList sounds weird..
EDIT:
Maybe the question wasn’t clear.
I’m not asking how to convert the array-of-arrays in json but WHAT to convert.
In my case I know the result of the conversion and I can choose the starting structure.
Other structures, instead of “LinkedList of LinkedLists” that json-ized are like this:
[ [ x, y ] , [ z, k ] , … ]
If u dont want to use any collection class then by simply using following code u can make the string required to u for JSON.In following code u can keep the num variable value dynamic.