| Author |
Skipping element addition in list
|
Eshwar Prasad
Ranch Hand
Joined: Mar 21, 2008
Posts: 191
|
|
I have a requirement to add elements from one list to another and during time if i encounter AB value second time, i have to add it in new list and not in current list, test. So I used the keyword continue if the values AB occurs. I am not getting the expected answer. My out put in list test should be as [9B, 9Y, AB, BC, BC]. Can any one please help me.
>
|
 |
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19216
|
|
|
After you add "AB" for the first time, your second list will contain "AB" for the remainder of the loop. It will therefore skip both "BC" values as well.
|
SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
|
 |
 |
|
|
subject: Skipping element addition in list
|
|
|