public void dataAnalytics()
{
double sum=0;
System.out.println("dataAnalytics for the Rural region");
for (Record ee :RList)
{
sum=sum+RList.get(4);
}
}
I have a very simple problem here , i am a novice java programmer , so please do be easy with me. I have an arrayLisl "Rlist" which has income in 4th index. What i am trying to accomplish is to get the sum of all income elements in the arraylist. I have tried sum=sum+RList.get(4); but i does not seem to work . income is initialized as double inthe super class but is passed in the arraylist constructor as string.