in the below text sum the amount to those FLAG & MA_NAME fields are same and put them in one array, and unique item append to that array i did some work but difficult to get unique items
FLAG MA_NAME SUM_AMT
-------- ---------------------------------------- ----------
Credit CASH 7777
Credit Salaries 9999
Credit Salaries Payable 2222
Credit Salaries Payable 5000
Credit State Bank of India 22
Credit State Bank of India 3000
Credit Sundry Debtors 2001
Credit Sundry Debtors 6666
Debit CASH 4444
Debit CASH 4999
Debit Salaries 3333
Debit Salaries 5678
Debit Salaries Payable 22
Debit Salaries Payable 4567
Debit State Bank of India 3333
Debit Sundry Debtors 3456
in tha below code iam getting duplicate variables, how to get unique items
for(i=0;i<p;i++)
{
String x=MANAME[i];
String y=FLAG[i];
int z=AMT[i];
for(j=i+1;j<p-1;j++)
{
String x1=MANAME[j];
String y1=FLAG[j];
int z1=AMT[j];
if((x.equals(x1)) && (y.equals(y1)))
{
NAME[l]=x;
CRDR[l]=y;
SUM[l]=z+z1;
l++;
}//if
}//for(j
}//for(i