Create a double array the same size as ArrayList2. Initialise a double variable to zero. For each item in ArrayList2, add the value to the double variable and insert it into the next element of the array.
Have a go at that and if you have any problems post your code telling us what the problem is (compilation - post the error(s), runtime - tell us what it is doing that you didn't expect)
Joined: Mar 19, 2008
Thanks for the reply.Below code I tried will work fine when j=0. But when j=1,i=0 it will just overlap the exisiting array, I know I need to get the length of latArr and lonArr, but don't know where to get that and how to pass that value into the loop so that my array values will not be overlaped.
If you find it hard to work with arraylist.size(), try using the enhanced for looping the arraylist, setting the j and i outside. And increment j and/or i accordingly. This should get you sorted with arraylist overlapping.