I'm trying convert java primitive array to JSONArray, but I have strange behaviour.My code below.
long [] array = new long[]{1, 2, 3};
JSONArray jsonArray = new JSONArray(Arrays.asList(array));
jsonArray.toString();
output is ["[J@532372dc"]
Why Do I get this output? I want to get output like this [1, 2, 3]
new JSONArray(array)
is sufficient to supply a (primitive) array to the constructor. – user2864740 Aug 12 '14 at 7:48