• Post Reply Bookmark Topic Watch Topic
  • New Topic

ArrayList issue  RSS feed

 
Joseph Smithern
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have this test working where it outputs the word "test" based on a calculated result:



Now I would like to stop using the String test (String targetItems = "test"; ) and put real data in using an ArrayList but my attempt outputs a huge array of info for each record:


Please advise how I can get this to work with targetItems ArrayList. Do I need another for loop inside my for loop?
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Did you compile the code that you posted? Because what you posted shouldn't compile.

Henry
 
pete stein
Bartender
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, perhaps it's me, but your post confuses me. You may need to tell more details here.

Also, this is unusual:


as it appears that you're adding a targetItems array list object plus a String(???) plus an int (???). Why?

Does it even compile?
 
Joseph Smithern
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is my original that did work with a String test value of "test":

Now I need to use real data which will be coming from the ArrayList targetItems I showed earlier.
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Joseph Smithern wrote:Here is my original that did work with a String test value of "test":

Now I need to use real data which will be coming from the ArrayList targetItems I showed earlier.


This code shouldn't compile either. How did you get this to work?

Henry
 
Rob Spoor
Sheriff
Posts: 21135
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please PostRealCode.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!