I have an example that calculates total expense and income. There are some values in integer array that converted from a string array. Once I am running the code the sum is 6000 and running again the same code the sum gets multiplied to 12000. How can I override this problem. Please check my code given below..
public static int incSum=0;
int[] numbersinc = new int[theAmount.length];
for(int i=0;i<theAmount.length;i++)
{
numbersinc[i]=Integer.parseInt(theAmount[i]);
incSum=incSum+numbersinc[i];
}
Log.e("SUM INC","Sum Inc= "+incSum); <<<<<- This sum is multiplying