•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the JSP section within the Web Development category of DaniWeb, a massive community of 374,151 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,444 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JSP advertiser: Lunarpages JSP Web Hosting
Views: 432 | Replies: 5
![]() |
•
•
Join Date: Feb 2008
Posts: 26
Reputation:
Rep Power: 1
Solved Threads: 1
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

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•
•
Join Date: Feb 2008
Posts: 26
Reputation:
Rep Power: 1
Solved Threads: 1
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 [tex] 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•
•
Join Date: Nov 2004
Location: Netherlands
Posts: 5,588
Reputation:
Rep Power: 18
Solved Threads: 187
now analyse what you wrote and translate it into correct English.
When you've done that come back and try again. What you wrote there is impossible to comprehend.
When you've done that come back and try again. What you wrote there is impossible to comprehend.
42 Private messages asking for help will be ignored
In the frozen land of Nador they were forced to eat Steve's iMinstrels, and there was much rejoicing.
In the frozen land of Nador they were forced to eat Steve's iMinstrels, and there was much rejoicing.
•
•
Join Date: Dec 2004
Location: London or Slovakia
Posts: 1,907
Reputation:
Rep Power: 9
Solved Threads: 216
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb JSP Marketplace
Similar Threads
- memory management in wndows 2000 (Windows NT / 2000 / XP / 2003)
- php/mysql dynamic multi-level menu problem (MySQL)
- I've got Trojan.Holax... is this bad? (Viruses, Spyware and other Nasties)
- not-a-virusadware (Viruses, Spyware and other Nasties)
Other Threads in the JSP Forum
- Previous Thread: Tomcat, JSP, IIS and multiple sites
- Next Thread: First Servlet



Linear Mode