This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.
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.